Forrest logo
tool overview
On this page you find all important commands for the CLI tool pkill. If the command you are looking for is missing please ask our AI.

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 will forcefully terminate the specified processes using the SIGKILL signal. Pkill provides various options for fine-grained control, such as the ability to exclude certain processes from termination, suppress confirmation prompts, or only show matching processes without killing them. It is particularly useful in situations where there is a need to kill multiple processes that match a specific name or pattern, saving time and effort compared to terminating them individually. Pkill can also be used with administrative privileges (by running it as a superuser or using sudo) to terminate processes owned by other users. However, caution must be exercised when using pkill, as terminating processes without proper consideration can lead to data loss, system instability, or unintended consequences. Overall, pkill is a powerful tool that provides a convenient and efficient way to terminate processes based on their attributes, contributing to smoother system management.

List of commands for pkill:

  • pkill:tldr:032fe pkill: Kill all processes which match.
    $ pkill "${process_name}"
    try on your machine
    explain this command
  • pkill:tldr:1c66b pkill: Force kill matching processes (can't be blocked).
    $ pkill -9 "${process_name}"
    try on your machine
    explain this command
  • pkill:tldr:5db8d pkill: Kill the main `firefox` process to close the browser.
    $ pkill --oldest "${firefox}"
    try on your machine
    explain 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 machine
    explain this command
  • pkill:tldr:9b042 pkill: Send SIGUSR1 signal to processes which match.
    $ pkill -USR1 "${process_name}"
    try on your machine
    explain this command
tool overview