pgrep / pkill

List or send signal to processes based on names and other attributes

List processes called sshd and owned by root:

pgrep -u root sshd

List all processes owned by root or daemon (special account)

pgrep -u root,daemon
pkill -x -signal 9 -u khai httpd

is way better than

kill -9 `ps -elf | grep khai | grep httpd | gawk '{ print $4 }'`
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License