Sometimes we need informations about some process. The
ps provide this information, but we need to filter. Most of us uses the command
ps aux | grep ..., but this shows more then we need and is unnecessarily long to write.
So... I use this script:
#!/bin/bash
search="$( echo "$@" | sed -r "s/([a-z0-9])/[\1]/i" )"
ps aux | egrep -i "^USER|$search" | egrep -v "$0"
With this script on my path
(/usr/local/bin/ps-grep is a got place) is more easy to find a program process informations.
$ ps-grep firefox
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
aurelio 20113 15.2 5.6 346212 176308 ? Sl 10:08 12:40 /usr/lib/iceweasel/firefox-bin -a iceweasel
caiosba 27387 4.9 12.7 487804 395024 ? Sl Aug24 83:39 /usr/lib/iceweasel/firefox-bin -a iceweasel