How to Kill Processes via the Terminal

I’ve ran into this issue, from time to time, where I can’t access my graphical system monitoring tool (System Monitor) to kill processes. Luckily at that time I do have access to Terminal. The next question is, “Well; how do I view the processes running and how do I kill them?” Good question (I sound like a schizophrenic), let me tell you how to view your active processes, all processes, and how to MDK (murder death kill; Demolition Man reference) them.
Bash Command, “PS”
Open your terminal of choice and you will have the bash command “ps” available to you. “PS” stands for “process”; simple enough. You can find more about the bash command by typing in “man ps”. It will bring up the “man page” (Linux User’s Manual).
- Type “ps -e” or “ps -A”, to list all processes running, and press <ENTER>.
- Scroll down to find the program you want to kill and remember the process id number (pid).
- Then type “kill {pid}” and press <ENTER>. Replace {pid} with the actual process id number.
Example:
In this example, we’ll say that tomboy was causing your system to freeze up and you needed to get rid of that process. After you execute the command “ps -e” to see all processes, find “tomboy” and remember the pid in the first column. Then run the kill command.
ps -e
kill 3009
Understanding the “Process”
According to the Linux User Manual, “ps” reports a snapshot of the current processes. What are processes, yeah this might be a good time to explain that. Check out Wikipedia… isn’t that where everyone gets their solid facts from!? Well anyway, a process is a running program; a task to be executed, especially one which is largely self-contained. Seriously; I’m not going to write a lot about it. Wikipedia has a lot more information.
If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!