# ps -aux | grep tail root 19775 0.1 0.2 968 656 pts/3 S 17:07:27 0:00 grep tail root 3030 0.0 0.2 1008 696 pts/4 S 10:23:21 0:00 tail -f /var/adm/dd # ps -aux | grep 't\ail' root 3030 0.0 0.2 1008 696 pts/4 S 10:23:21 0:00 tail -f /var/adm/dd #### or # ps -aux | grep '(httpd|named)' | grep -v grep or #!/usr/bin/perl @ps = qx(ps aux); @httpd = grep {/httpd/} @ps; @named = grep {/named/} @ps; print "httpd's:\n\t", join("\n\t", @httpd), "\nnamed's:\n\t", join("\n\t", @named), "\n";