Quote:
Originally Posted by Latch
Unless it catches it's own grep.... I've run into that often enough.
Code:
latch@afx:~$ ps -ef | grep tomato
latch 24337 24325 0 18:12 pts/457 00:00:00 grep tomato
latch@afx:~$
gotta grep out the grep.. i.e.:
ps -ef | grep proccessIDorprocessName | grep -v grep
Then you can pipe to wc -l or whatever you'd like hehe.
Code:
latch@afx:~$ ps -ef | grep bash
latch 8370 1 0 Aug12 ? 00:00:00 /bin/bash /usr/bin/thunderbird
latch 25518 1 0 Aug14 ? 00:00:00 /bin/bash ./restartScript
latch 24020 1 0 17:59 ? 00:00:00 /bin/bash /usr/bin/firefox
latch 24325 24323 0 18:12 pts/457 00:00:00 -bash
latch 24434 24325 0 18:15 pts/457 00:00:00 grep bash
latch@afx:~$ ps -ef | grep bash | grep -v grep
latch 8370 1 0 Aug12 ? 00:00:00 /bin/bash /usr/bin/thunderbird
latch 25518 1 0 Aug14 ? 00:00:00 /bin/bash ./restartScript
latch 24020 1 0 17:59 ? 00:00:00 /bin/bash /usr/bin/firefox
latch 24325 24323 0 18:12 pts/457 00:00:00 -bash
latch@afx:~$ ps -ef | grep bash | grep -v grep | wc -l
4
latch@afx:~$
|
Ahhhhh... The vageuries of different shells, systems and utilities. How many things in hte Windows world spawn such great conversation?