Skip to content
Related Articles
Get the best out of our app
GFG App
Open App
geeksforgeeks
Browser
Continue

Related Articles

kill command in Linux with Examples

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

kill command in Linux (located in /bin/kill), is a built-in command which is used to terminate processes manually. kill command sends a signal to a process which terminates the process. If the user doesn’t specify any signal which is to be sent along with kill command then default TERM signal is sent that terminates the process.

Options and examples

1. kill -l :To display all the available signals you can use below command option:

Syntax:

$kill -l

Signals can be specified in three ways:

  • By number (e.g. -5)
  • With SIG prefix (e.g. -SIGkill)
  • Without SIG prefix (e.g. -kill)

Note:

  • Negative PID values are used to indicate the process group ID. If you pass a process group ID then all the process within that group will receive the signal.
  • A PID of -1 is very special as it indicates all the processes except kill and init, which is the parent process of all processes on the system.
  • To display a list of running processes use the command ps and this will show you running processes with their PID number. To specify which process should receive the kill signal we need to provide the PID.

    Syntax:

    $ps
    

2. kill pid : To show how to use a PID with the kill command.

Syntax:

$kill pid

3. kill -s : To show how to send signal to processes.

Syntax:

kill {-signal | -s signal} pid 

4. kill -L :This command is used to list available signals in a table format.

Syntax:

kill {-l | --list[=signal] | -L | --table} 
My Personal Notes arrow_drop_up
Last Updated : 22 May, 2019
Like Article
Save Article
Similar Reads
Related Tutorials