Chinaunix首页 | 论坛 | 博客
  • 博客访问: 239885
  • 博文数量: 19
  • 博客积分: 2500
  • 博客等级: 少校
  • 技术积分: 435
  • 用 户 组: 普通用户
  • 注册时间: 2006-03-15 15:40
文章分类

全部博文(19)

文章存档

2011年(1)

2010年(2)

2009年(5)

2008年(11)

我的朋友

分类: LINUX

2009-05-22 16:01:45


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

阅读(727) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~