I've been struggling with disk space in Windows the last little while, having worked on a variety of different projects and installed lots of software over the course of a year.

Of course one easy way to free yourself is to use the Control Panel to remove programs you no longer use. For instance, Adobe Acrobat 8.0 takes up 1.1GB on my hard drive thanks to my employer, and I've never even used it.

Another way is to figure out where all your disk space is being eaten up at the file-level. Using cygwin, the following command is what I've used - feel free to share your more sophisticated versions below.

$ cd /cygdrive/c/

$ du -k . 2>/dev/null | sort -nr > diskalloc.txt

Let it run for minutes/hours then check out c:\diskalloc.txt. It will show you the worst offenders first. I was surprised to find out that I had 1GB in my "Local Settings/Temp". Also I had forgotten that I had built Inkscape months ago and just left the object files lying around. That's another 1GB of wasted disk space.

Just be careful not to delete anything you think Windows might need to function!

§506 · October 30, 2008 · Linux, Software, Technology · Tags: , , , , · [Print]

6 Comments to “Who’s got my Disk Space”

  1. dbt says:

    I prefer doing du -xk (the -x doesn’t mean squat on windows, of course) > file and then sorting the file separately, it lets you get a partial picture much quicker.

  2. Why not use:

    $ cd /cygdrive/c/

    $ du -k . 2>/dev/null | sort -nr | head -50 > diskalloc.txt

    In order to lower the size of the diskalloc.txt file? 😉

  3. @François: Yes, the ‘head’ command works fine, but it doesn’t save any time in execution. I figure if you’re going to wait that entire time, you might as well get the entire disk contents 🙂

  4. Rob Russell says:

    I usually do something like du -hs * to get a summary by directory then drill down and repeat. Doesn’t take as long as you might expect on an ext3 partition in Linux, not sure how it’d go on cygwin.

  5. @Rob: yeah that’s useful but: 1) lots of ugly “Permission denied” using cygwin (would want to use 2>/dev/null) and 2) “Program Files” and “Documents and Settings” are usually the two biggest culprits so I’d have to do multiple commands at various points to get a good picture.

  6. I’m a bit late to this conversation, but I had to free up some space on a relatives’ computer, and the best tool I could find was one called SpaceMonger. There’s quite an old, but free, version fairly readily available.