Who took my slice of pi ? Sometimes I ask myself that while looking in the fridge. This time, I am looking at the top command and see nearly a quarter of the reserved swap space in use. The question is purely academic, and spurred by curiosity, I wrote a bash script to learn the answer. The script, swapid, searches through the process list, identifies the process name and amount of swap used, and then sorts the output by swap size. With Linux, processes can be viewed and interrogated like a file system. Run $ ls /proc and you'll see it sprinkled with subdirectories named with numbers. These numbers correspond to process ids. Inside each of these subdirectories is a file named status , and running $ cat status reveals a bunch of process information. At this point, it's simply a matter of using awk and grep to pick out the attributes of interest; in this case, "Name" and "VmSwap." Output is written to the /tmp directory, sorted, printed to the