Linux Command


pkill [options] pattern


pgrep looks through the currently running processes and lists the pro-
cess IDs which matches the selection criteria to stdout. All the cri-
teria have to match. For example,

pgrep -u root sshd

will only list the processes called sshd AND owned by root. On the
other hand,

pgrep -u root,daemon

will list the processes owned by root OR daemon.

pkill will send the specified signal (by default SIGTERM) to each pro-
cess instead of listing them on stdout.

Share your experience or ask a question