pkill
Pkill is a command line tool used in Unix and Unix-like operating systems to send signals to running processes and terminate them based on specific criteria. It stands for "process kill."
The pkill command is used to find and kill processes by their names or other attributes, making it convenient for quickly terminating multiple processes at once.
Unlike the kill command, which operates based on process IDs (PIDs), pkill simplifies the process of identifying and terminating processes by allowing users to specify partial or complete process names or even regular expressions.
Pkill uses signals to terminate processes, with the default signal being SIGTERM (terminate), but users can specify different signals if needed.
For example, pkill -9
List of commands for pkill:
-
pkill:tldr:032fe pkill: Kill all processes which match.$ pkill "${process_name}"try on your machineexplain this command
-
pkill:tldr:1c66b pkill: Force kill matching processes (can't be blocked).$ pkill -9 "${process_name}"try on your machineexplain this command
-
pkill:tldr:5db8d pkill: Kill the main `firefox` process to close the browser.$ pkill --oldest "${firefox}"try on your machineexplain this command
-
pkill:tldr:7620e pkill: Kill all processes which match their full command instead of just the process name.$ pkill -f "${command_name}"try on your machineexplain this command
-
pkill:tldr:9b042 pkill: Send SIGUSR1 signal to processes which match.$ pkill -USR1 "${process_name}"try on your machineexplain this command