Using Terminal to Shutdown Processes

Linux

XFCE does not come with a system monitor utility like the one I had in Gnome. I used the utility to kill unresponsive processes. So how do we kill unresponsive programs using the terminal? To understand how Linux handles processes and how you can control them read this great article by Gary Sim (in plain English). Here is what I learnt from Gary’s article.

We need to know the process id of the program that is not responding. We find out process id or PID by running the command

ps aux

This command displays all running processes. Below are a few of the many running processes on my computer. The list is long so I am only showing you a few to give you an idea.

USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
nom 3006 0.0 0.3 2476 772 ? S 23:15 0:00 gnome-pty-helpe
nom 3097 0.0 4.0 16584 10348 ? Ss 23:23 0:01 gksu -u root /u
root 3102 0.0 0.4 3712 1068 pts/1 Ss+ 23:23 0:00 /bin/su root -c
root 3105 0.0 0.2 2256 592 pts/1 S+ 23:23 0:00 /usr/lib/libgks
nom 3321 0.7 3.2 14920 8364 ? Ss 23:44 0:01 mousepad

Now find out which one of them you want to kill. I want to kill the mousepad it has the PID 3321 and I kill it by running this command:

kill 3321

Just incase if this command doesn’t work you can try

kill -9 3321

I am very happy with XFCE. But I need to find out a nice and lite pdf viewer. Evince is great but how could I download evince without downloading so many gnome libs? There is an evince-gtk package in Debian experimental but I can not install it due to dependency issues.

Related Posts

5 thoughts on “Using Terminal to Shutdown Processes

  1. xkill works the best.

    On another note I am looking around to find how to kill the CapsLock key. I almost never use it and would much earerly switch it to make it another Control or Meta key.
    At Paxym (www.paxym.com), we are doing Kernel (QNX Neutrnio, FreeBSD, Linux) development and Network Security Apps (DPI, Anti-Virus, IDS, Firewall) and other Device Driver development for Octeon Multicore Mips processors. Our dev hosts are running Fedora. But I will try switching to Ubuntu on my office machines. If our SDKs perform fine, I will preach to the whole SW team.

  2. Ever heard of xfce4-taskmanager? It is default in Xubuntu 7.10 and should come with most other recent distributions also…

  3. 1. Use pkill. It lets you not have to know the exact name. For instance, I can type “pkill firefox” without knowing the process is called firefox-bin.

    2. Use xkill. Press alt+f2 and type in xkill, or better yet, make a keyboard shortcut. Then skulls come up. Click on what you want to kill an it’ll go away.

Leave a Reply

Your email address will not be published. Required fields are marked *