Comment on pidof

groxx:

Well, obviously there are plenty of ways of finding PIDs and killing running processes (and more quickly than you suggest). If you just want to kill a process whose name you already know, for instance, just killall PROCESS.

If you want to kill a process whose name you don't quite know, know how to spell, or are too lazy to write, use a bash script like:

#!/bin/bash
killall $(ps -Ac | grep "$@")

But then the above script doesn't ignore capitalization, so that's a pain in the ass. So you'd modify the script, and so on. The point is that pidof already does all this, and very elegantly. Furthermore, he GPLed it, so you can modify the source to do anything else that you want it to.

The author has a few other command line tools that are very useful, but that you could give the same argument about. xstat in particular shows a bunch of info on a file that would normally take 3 commands to find out. Also GPL.