ITPub博客

首页 > Linux操作系统 > Linux操作系统 > pgrep 查询进程的工具

pgrep 查询进程的工具

原创 Linux操作系统 作者:tonykorn97 时间:2006-11-07 00:00:00 0 删除 编辑

pgrep 是通过程序的名字来查询进程的工具,一般是用来判断程序是否正在运行。在服务器的配置和管理中,这个工具常被应用,简单明了;


用法:


#ps 参数选项 程序名

常用参数


-l 列出程序名和进程ID;
-o 进程起始的ID;
-n 进程终止的ID;

举例:


[root@localhost ~]# pgrep -lo httpd
4557 httpd
[root@localhost ~]# pgrep -ln httpd
4566 httpd
[root@localhost ~]# pgrep -l httpd
4557 httpd
4560 httpd
4561 httpd
4562 httpd
4563 httpd
4564 httpd
4565 httpd
4566 httpd
[root@localhost ~]# pgrep httpd
4557
4560
4561
4562
4563
4564
4565
4566

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/312079/viewspace-245513/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: samba出错!
请登录后发表评论 登录
全部评论

注册时间:2007-12-05

  • 博文量
    1854
  • 访问量
    2088481