Stop processes
Process communicate with each other using signals. A process signal is a predefined message that process recognize and may choose to ignore or act on.
Linux Process Signal
- 1 HUG Hangs up
- 2 INT Interrupts
- 3 QUIT Stop running
- 9 KILL Unconditionally terminates
- 11 SEGV Produces segment violation
- 15 TERM Terminate if possible
- 17 STOP Stops unconditionally, but doesn't terminate
- 18 TSTP Stops or pause, but continues to run in background
- 19 CONT Resume execution after STOP or TSTP
The kill command
The kill command allows you to send signals to processes based on their process ID.(Default TERM)
$ sudo kill 3940
$ sudo kill -9 3940
$ sudo kill -s HUP 3940
The killall command
The killall command is a powerful way to stop processes by using their names rather than the PID numbers.(wildcard characters)
# killall nginx*