Grepping processes

Grepping ps output will result in grep showing its own process:
[skanx@po-sr-nm ~]$ ps -efH|grep bash
skanx 28142 8787 0 11:59 pts/6 00:00:00 bash
skanx 28346 28142 0 12:01 pts/6 00:00:00 grep –color=auto bash

Instead, use ps -efH|grep [b]ash:
[skanx@po-sr-nm ~]$ ps -efH|grep [b]ash
skanx 28142 8787 0 11:59 pts/6 00:00:00 bash

Leave a Reply

Your email address will not be published.