- Kill all processes which match:pkill -9 [process_name]- Kill all processes which match their full command instead of just the process name:pkill -9 -f "[command_name]"- Send SIGUSR1 signal to processes which match:pkill -USR1 [process_name]
pgrep [options] pattern pkill [options] pattern
pgrep looks through the currently running processes and lists the process IDs which match the selection criteria to stdout. All the criteria have to match. For example,
will only list the processes called sshd AND owned by root. On the other hand,
will list the processes owned by root OR daemon.
pkill will send the specified signal (by default SIGTERM) to each process instead of listing them on stdout.
Example 1: Find the process ID of the named daemon:
Example 2: Make syslog reread its configuration file:
Example 3: Give detailed information on all xterm processes:
Example 4: Make all netscape processes run nicer:
The process name used for matching is limited to the 15 characters present in the output of /proc/pid/stat. Use the -f option to match against the complete command line, /proc/pid/cmdline.
The running pgrep or pkill process will never report itself as a match.
The options -n and -o and -v can not be combined. Let me know if you need to do this.
Defunct processes are reported.
ps(1), regex(7), signal(7), killall(1), skill(1), kill(1), kill(2)
Kjetil Torgrim Homme
Please send bug reports to