Chinaunix首页 | 论坛 | 博客
  • 博客访问: 351667
  • 博文数量: 51
  • 博客积分: 916
  • 博客等级: 准尉
  • 技术积分: 539
  • 用 户 组: 普通用户
  • 注册时间: 2008-12-01 15:37
文章分类

全部博文(51)

文章存档

2014年(1)

2012年(49)

2011年(1)

我的朋友

分类: LINUX

2012-03-09 12:38:46

通常在使用ps命令后用管道连接查询特定进程会显示grep进程本身
如:

点击(此处)折叠或打开

  1. ps aux | grep init
  2. 输出如下:
  3. root 1 0.0 0.3 2760 1600 ? Ss Mar08 0:03 /sbin/init
  4. tester 10192 0.0 0.1 3328 876 pts/0 S+ 12:41 0:00 grep --color=auto init
过滤掉grep进程本身的输出:
1.

点击(此处)折叠或打开

  1. ps aux | grep init | grep -v grep
  2. root 1 0.0 0.3 2760 1600 ? Ss Mar08 0:03 /sbin/init
2.在进程名任何一个字母上添加[]

点击(此处)折叠或打开

  1. ps aux | grep ini[t]
  2. 输出:
  3. root 1 0.0 0.3 2760 1600 ? Ss Mar08 0:03 /sbin/init



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