I remember reading an answer to this question a few years ago - I've searched but can't find it. If I want to grep the process list for a process I've just run I always get my grep process in the output. I can remove this by piping to grep -v grep but I know there's a more elegant solution, using [grep] if I remember rightly. Can anyone remind me what the answer is?
example:
Cheers, Chris
example:
Code:
# sleep 500 &
24851
# ps -ef | grep sleep
root 24855 24803 0 13:18:08 pts/9 0:00 grep sleep
root 24851 24803 0 13:18:04 pts/9 0:00 sleep 500
#
# ps -ef | grep sleep | grep -v grep
root 24851 24803 0 13:18:04 pts/9 0:00 sleep 500
#
Cheers, Chris