When performing a grep filtering across pipes, as in the following example,
$ ps -ef | grep 24604
username 18660 24604 0 16:38 pts/3 00:00:00 ps -ef
username 18661 24604 0 16:38 pts/3 00:00:00 grep --color=auto 24604
username 24604 23548 0 Aug13 pts/3 00:00:00 /bin/bash
the grep command itself is part of the results, and usually - I filter it out with another grep -v,
viz.:
$ ps -ef | grep 24604 | grep -v grep
username 20375 24604 0 16:40 pts/3 00:00:00 ps -ef
username 24604 23548 0 Aug13 pts/3 00:00:00 /bin/bash
Is there a grep
argument which will filter out the grep string?
(Or any other trick to avoid the grep -v
?)