- The Long (old) Version
- The Short (new) Version
Let's get a list of all the running processes and they're PID. Open up the terminal (CTRL+ALT+T) and paste the following:
ps -A
Take a note of the PID number. Now:
kill -9 (PID)
Now for a little bit of customization, you can add the grep pipe feature to filter only the application that you want. For example:
ps -A | grep firefox
or simply run
pgrep firefox
Will give you only the lines that contain the word "Firefox" as the process, so you can kill only that.
Why not combine the two in one simple command? Try:
kill -9 $(pgrep firefox)
This command will start the "kill" but it will automatically search for any process named "firefox" so be sure of the process that you want to kill.
Now for the "kill" command, you can use the following signals:
Number | Name (short name) | Description | Used for |
---|---|---|---|
0 | SIGNULL (NULL) | Null | Check access to pid |
1 | SIGHUP (HUP) | Hangup | Terminate; can be trapped |
2 | SIGINT (INT) | Interrupt | Terminate; can be trapped |
3 | SIGQUIT (QUIT) | Quit | Terminate with core dump; can be trapped |
9 | SIGKILL (KILL) | Kill | Forced termination; cannot be trapped |
15 | SIGTERM (TERM) | Terminate | Terminate; can be trapped |
24 | SIGSTOP (STOP) | Stop | Pause the process; cannot be trapped. This is default if signal not provided to kill command. |
25 | SIGTSTP (STP) | Terminal | Stop/pause the process; can be trapped |
26 | SIGCONT (CONT) | Continue | Run a stopped process |
Note the specific mapping between numbers and signals can vary between Unix versions.
Amazing info right? Yes it is. And now that you understood how to use the above commands, forget them and use this one:
pkill firefox
This command will find the Process, the PID and kill it AIO (all in one).