compilation process of cpp
Compilation Process of C++
October 31, 2023
what does preprocessor-do in cpp
What Does Preprocessor Do in C++?
November 23, 2023

November 9, 2023

Linux kill commands

There are usually three kill commands in most of the linux distributions: `kill`, `pkill`, `killall`.

They are all used to send a signal to one or more processes.

The main distinction is how they choose the processes they are going to send a signal to.

kill: sends a signal to the process given by its process id (PID)

$ sleep 100 &
[1] 13793
$ kill 13793

killall: sends a signal to all processes matching the given name

$ sleep 50 &
[1] 19194
$ sleep 100 &
[2] 19196
$ killall sleep
[1]-  Terminated              sleep 50
[2]+  Terminated              sleep 100

pkill: sends a signal to processes matched by the given regular expression pattern

$ sleep 100 &
[1] 19277
$ ./sleep.sh &
[2] 19282
$ pkill sleep
[1]-  Terminated              sleep 100
[2]+  Terminated              ./sleep.sh
Linux kill commands
This website uses cookies to improve your experience. By using this website you agree to our Data Privacy Statement
Read more