 |
| |
[06/16/2011]
UNIX: Count processes containing text
By: Mark Jacobsen
Ever want to know if something is running on a Unix box, but only know the name or even part of the name of the file or path? You can find it using the following command...
EXAMPLE:
ps -ef|grep "script.pl"|grep -v "grep"|wc -l
MEANING:
ps -ef|grep "script.pl"
Lists all processes that contain "script.pl"
grep -v "grep"
removes the processes that contain grep (i.e. the orig grep command will show up as a process match)
wc -l
counts the number of "lines"/processes
===================
Mark Jacobsen: I hope you have found this article or tip helpful. If so, please consider making a donation. 100% of all proceeds will be directed to charity: water.
Contact me at MarkJacobsen.net or @MarkJacobsen
|
|
 |
Thanks for stopping by. Please be sure to visit some of my sites for your communication needs: Toll Free Virtual PBX, Real Estate Call Capture, Hosted PBX, and Virtual Fax.
All News Articles...
|
|