Skip to content

What is pkill Linux command?

The pkill command in Linux is a powerful tool used to terminate processes based on their name or other attributes. It provides a convenient way to stop processes without needing to know their ID, offering efficient management of system resources.

Terminal window
pkill [options] [pattern]
OptionDescription
-e, —exactMatch the exact process name
-f, —fullMatch against full argument lists
-i, —ignore-caseIgnore case when matching
-x, —pidMatch the processes owned by the specified PIDs
-g, —pgroupMatch the processes in the process group ID specified
-s, —sessionMatch the processes in the session ID specified
-u, —euidMatch the processes with effective user ID specified
-P, —parentMatch the processes with the specified parent process ID
ParameterDescription
patternThe pattern to match the process to be killed
Terminal window
pkill firefox

Terminates all processes with the name “firefox”.

Terminal window
pkill -9 12345

Forcibly terminates the process with PID 12345.

Terminal window
pkill -g 54321

Terminates all processes in the process group with GID 54321.

Terminal window
pkill -u username

Ends all processes owned by the user with the username “username”.

Terminal window
pkill -SIGKILL chrome

Sends the SIGKILL signal to terminate all processes with the name “chrome”.

{Questions}

  • Killing a process by name
  • Terminating multiple processes at once
  • Providing a more user-friendly alternative to the kill command