September 5, 2009
kill just doesn’t do it for you. Have you tried
killall? Oh well in that case I would suggest
pkill is very similar to
killall. If you entered pkill firefox, it would find all processes related to firefox and do away with them right away. The advantage of doing this over using the
ps ux trick mentioned in this post, is that you don’t have to do the searching yourself. And run the risk of missing a process. As for an advantage over
pkill can be used with regular expressions. Also, with
killall you need to get the name exactly right. Thus to kill the mozilla browser you would have to run
killall mozilla-bin and not
I personally have not found a need to use
pkill as of yet, but you never know when it will come in handy.
July 22, 2009
Well not too much new has gone on. I’ve recently started playing around with the Bluetooth capabilities, but don’t have anything useful to say thus far.
But don’t worry I have something that might be interesting. Though not entirely new it will combine some commands that have been previously mentioned, and make life easier.
Remember back when I first talked about kill, I said that you only had to type
ps ux | less then
kill <process number>. Well the only “problem” with this approach is that you have to search through the list of process to find the one that you want. So here is a cool little trick that might help, if you know part of the process name, that uses
ps ux | grep "audacity"
This will only output all the process whos “name” contains audacity. This is pretty useful, especially if you are lazy and not in the mood to read through the rest of the rubbish. You will still have to use
kill but all the real work has been removed.
July 11, 2009
So you’re messing around and all of a sudden a program or 2 or even more stop responding. What do you do? Well for starters you DON’T restart your system, well not initially anyway.
If a program (process) starts to act up and gets out of line, you are perfectly within your rights to go psyco and
kill it. To use this command there are a few things you need to know, well really just one thing (other than some options you can use), and that’s the process number! This isn’t too hard to find just enter
ps ux | less, the
less is there so that you can scroll just in case the output is more than one page long. This will list all of the processes that you (the user) are currently running. However you can also enter
ps aux | less, to list ALL process that are running. Reading the table isn’t difficult so once you find what you are looking for just remember the number.
Now the fun begins. Suppose that the process number happens to be 7331. Then the first thing to try is
kill 7331. If this doesn’t work then enter
kill -9 7331. The -9 will force the process to be killed without interruption (which might have caused
kill 7331 not to work). A command similar to
killall, which works with process names rather than process numbers. So if 7331 were say firefox you would enter
killall firefox. I should note that
killall will end ALL instances of the program (firefox in this case) and not just the one that is misbehaving (7331). More info on
killall can be found here.
Here is a little video to help you remember all of this.