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

kill

The command line tool "kill" is a widely-used utility in Unix-like operating systems. It is used to terminate a process by specifying its process ID (PID).

Kill is mainly used to forcefully stop or terminate a program that is either not responding or needs to be stopped immediately. It effectively sends a signal to the specified process or processes, asking it to terminate.

The default signal sent by kill is SIGTERM (terminate signal), which gracefully asks the process to exit. However, it can also send other signals like SIGKILL, which forcefully terminates the process without giving it a chance to clean up its resources.

The kill command can be used with various options, such as -9, which sends the SIGKILL signal, or -l, which lists the available signals that can be sent. Additionally, kill can be used with process names or group IDs instead of PIDs.

Superusers (root) have the ability to kill any process on the system, while regular users can only kill processes they own.

Kill is often used in conjunction with other commands or scripts to automate the process termination. It is also commonly used in troubleshooting and managing system resources when a process is causing issues or consuming excessive resources.

Using kill without specifying any options or arguments displays the syntax and usage instructions of the command.

It is important to exercise caution while using kill, especially with the SIGKILL signal, as it may result in data loss or corruption if a process is forcefully terminated without proper cleanup.

List of commands for kill:

  • dd:tldr:f721c dd: Check the progress of an ongoing dd operation (run this command from another shell).
    $ kill -USR1 $(pgrep ^dd)
    try on your machine
    explain this command
  • kill:tldr:23e73 kill: Terminate a background job.
    $ kill %${job_id}
    try on your machine
    explain this command
  • kill:tldr:63124 kill: List available signal names (to be used without the `SIG` prefix).
    $ kill -l
    try on your machine
    explain this command
  • kill:tldr:9feed kill: Terminate a program using the default SIGTERM (terminate) signal.
    $ kill ${process_id}
    try on your machine
    explain this command
  • kill:tldr:d2425 kill: Send a `SIGUSR1` signal to all processes with the given GID (group id).
    $ kill -${SIGUSR1} -${group_id}
    try on your machine
    explain this command
  • kill:tldr:ecb48 kill: Terminate a program using the SIGHUP (hang up) signal. Many daemons will reload instead of terminating.
    $ kill -${select} ${process_id}
    try on your machine
    explain this command
  • odps-inst:tldr:b0bab odps-inst: Kill an instance.
    $ kill ${instance_id};
    try on your machine
    explain this command
  • pidof:tldr:87045 pidof: Kill all processes with given name.
    $ kill $(pidof ${name})
    try on your machine
    explain this command
  • runit:tldr:24ce1 runit: Shut down runit.
    $ kill --CONT ${runit_pid}
    try on your machine
    explain this command
  • shell:warp:d9ecb Kill processes at port
    $ kill $(lsof -t -i:${port})
    try on your machine
    explain this command
tool overview