Tuesday, July 22, 2008

What is biggest file on my hard disk?

su + sort

About ten years ago, whenever my hard disk space is running low, I used to run shell script using 'du' command to find out which file is taking biggest space and select victim file/directory to kill and save some room on my hard disk. Basically, the script uses 'du' command for each directory recursively from /root directory, after than, 'sort' command sorts that result descending order. Then the first item on the list is taking biggest space and so on.

Now, my SUSE linux has a gui application called 'KDirStat'. It exactly does same thing and shows the result even graphical way to help you more visually figure out which file you should delete to get some extra room on your hard disk .:)

For my experiments, I have 3 Matlab installed on my hard disk and each of it takes about 2GB. Because of these 3 Matlabs, my hard disk is running low and only 1GB is left. Now, I removed oldest version of Matlab and it resulted in 3G available disk space.