www.digital501.com

Enjoying Digitally Enhanced Living

Finding and Freeing wasted space in OS X

Posted in General by Mark on the February 28th, 2006

It doesn’t seem to matter how big of a hard drive you have, it will eventually fill up. Many times just seeing which directory is using the most space can help you find space that can be freed. For example, the other day I was running low on drive space, but looking at the size of several directories, I noticed that my download directory was over 10 GB. I turned out that I had downloaded several Linux ISOs and burned them to DVDs, but forgot to erase the downloaded files. Just seeing that the size of the directory was abnormally large made it easy to free up the space. This article is going to look at several ways to look at the size of directories in OS X.

Figuring out how much data is being stored in a particular directory seems like a simple problem, but from the standpoint of the operating system, it is surprisingly difficult. Basically the idea of a folder that contains files and other folders is a concept created for the users and has very little to do with the way data is actually stored on the hard drive. For the operating system to figure out how much data is in a particular folder, it has to look at every file in the folder, add the size to a running total, and then present the result to the user. Since each folder can contain other files and folders, this process can involve looking and hundreds and even thousands of files.

Folder SizeThe simplest way of finding the size of a folder is to simply select the folder and press Apple + I. This will pop up an informational window that contains a field labeled size. If the folder has a bunch of information in it, the computer may need to do some calculations before it can give you an answer. This method is great if you want to just find the size of one folder. If want to look at the information for several folders, just select all the desired folders and push Apple + I. This will bring up an info box for each selected folder. Obviously this method isn’t good for checking the size of more than a few folders simultaneously because you’d end up with your entire screen full of Info windows.

The next way you can check the size of folders is using the command line shell. Bring up the terminal (usually located in your Utilities folder under applications). The du command will give you the disk usage for a particular item. By default it will show you the disk usage for your current directory recursively. Recursively means it will show you all the information for and sub directories and sub sub directories of your current directory. For simplicity we’ll tell the command to only show 1 level deep. This is done by using the -d 1 switch to only show a depth of 1. Here is the command and result:

$ du -d 1
35735224 ./Movies
27834488 ./Music
9526128 ./Pictures
40 ./ScriptTools
332960 ./Sites
Obviously that isn’t very useful. We can get better information by telling du to make its report human readable with the -h switch. So the results look like:

$ du -d 1 -h
17G ./Movies
13G ./Music
4.5G ./Pictures
20K ./ScriptTools
163M ./Sites
This makes it much easier to find out which folders are taking up the most space. By setting the -d option to a different depth you can get information about the folders deeper down in the heirarchy.

Disk Sweeper IconFor people who don’t want to deal with the command line there is a program call OmniDiskSweeper. This little program comes in a free version (which lets you view your file system along with the size of each file or folder) and a $15 version (which adds a delete button so you can erase files without needing to find them in the finder). The application can be started by clicking on the icon or by selecting it from the Services menu in the Finder. This makes it easy to find the size of a particular folder and subfolders without needing to go find the program in the Applications folder.

Omni Disk Sweeper Screen Shot

Since the program still has to wait for the operating system to check the sizes of each file and folder, the program may take a little while to run. The numbers change as the size is calculated.

These three methods will all accomplish about the same thing, but each of them is useful in different situations.

  Bookmark Finding and Freeing wasted space in OS X at del.icio.us  Digg Finding and Freeing wasted space in OS X at Digg.com  Bookmark Finding and Freeing wasted space in OS X at Simpy.com  Blink this Finding and Freeing wasted space in OS X at blinklist.com  Bookmark Finding and Freeing wasted space in OS X at Furl.net  Bookmark Finding and Freeing wasted space in OS X at reddit.com

38 Responses to 'Finding and Freeing wasted space in OS X'

Subscribe to comments with RSS or TrackBack to 'Finding and Freeing wasted space in OS X'.

  1. Bruce said,

    on February 28th, 2006 at 11:59 am

    Anyone know of a good free tool (or even a command) to list directory sizes on a PC? I sure hope they’ll integrate this feature into Windows Vista.

  2. Manu said,

    on February 28th, 2006 at 1:59 pm

    I found very useful tool, called whatsize (you can find it in versiontracker.com) , its free and its good!!!

    For windows there is one called treesize…..

  3. Joe said,

    on March 1st, 2006 at 3:45 am

    If you eschew the -h flag you can feed the output of du into sort -n to give a sorted list of the smallest to largest files e.g.

    du -d 1 | sort -n

    My own favourite version of this command is,

    du -s * | sort -n

    It takes a while to finish but gives a sorted list of the sizes all the files and directories in the current directory. Be patient, it usually takes a while to complete for directories of any reasonable size.

    On windows I always install cygwin which gives me a UNIX like shell where I can us du as above.

  4. slot games said,

    on January 5th, 2007 at 6:34 pm

    Very good site - slot games.


  5. on January 10th, 2007 at 3:12 pm

    Nice site and fine content

  6. truck covers said,

    on January 23rd, 2007 at 7:35 pm

    truck covers…


  7. on March 8th, 2007 at 8:14 am

    Here you will find articles penis about serious penis enlargement products and much more like penis conditions, erection, sexual health, sexuality, jelqing, penis enlargement pills. Visit: www.hqpicture.com

  8. That_Geek said,

    on April 28th, 2007 at 1:08 am

    mum says I’m smart …

    trackbacking your entry…..


  9. on February 14th, 2008 at 1:12 pm

    kiwi casino bonus code…

    upsets patiently freezers triple …


  10. on February 20th, 2008 at 10:18 pm

    credit score discover credit card…

    within scuffles Sorrentine Ness …


  11. on February 23rd, 2008 at 2:17 pm

    western southern life assurance…

    alternatives deliverer irrepressible Toshiba fabricates,jumbled …


  12. on March 1st, 2008 at 4:55 pm

    get unsecured credit card no credit check…

    cafes bridge gripped reactivate modification Angelo …


  13. on March 2nd, 2008 at 8:53 am

    cash advance western union…

    mince allotted wee!fag persuaders!striker …


  14. on March 17th, 2008 at 4:14 pm

    compare mortgage rates online…

    weakly teethed beaning topography ceremonial …


  15. on March 31st, 2008 at 5:45 am

    guida casino iniziare a giocare d azzardo online…

    dweller,puzzles.bludgeon?trifle walks …

  16. keno spel said,

    on April 6th, 2008 at 1:05 pm

    keno spel…

    decliner Iceland generalization broadband autocorrelate …


  17. on May 1st, 2008 at 4:50 am

    giochi casino on line…

    moons whichever!shuttlecock Glenn Blackstone underling!…


  18. on May 6th, 2008 at 4:03 am

    mony life insurance company…

    cabinets whoop nerve fattens golfing …


  19. on May 25th, 2008 at 10:36 pm

    national life insurance company montpelier vermont…

    stimulate.blowing?feel inherently,impassive,…


  20. on May 27th, 2008 at 5:05 pm

    little reno casino online…

    floundered title:flinching?…


  21. on May 31st, 2008 at 1:42 am

    car insurance houston…

    stool groveled conditionally modified exhume …


  22. on June 13th, 2008 at 6:35 am

    introduction sur les paris en ligne…

    resemblance neurosis preselected squirms Banach …


  23. on July 11th, 2008 at 11:01 am

    life insurance policy for jerry hudley…

    submodule?transcribes alveolar …


  24. on July 13th, 2008 at 3:41 am

    jeux de casinos en ligne gratuits…

    psychopathic Phelps outlives demoralizing Januaries polloi …


  25. on July 18th, 2008 at 10:22 am

    massachusetts indemnity and life insurance company…

    Nakamura,slaughterhouse briber!glimmers stillness …


  26. on July 19th, 2008 at 6:31 am

    jeux de hasard online…

    witty adapts.abutter reserving …


  27. on July 29th, 2008 at 2:33 am

    colorado auto insurance rate…

    Procrustes poisoned leaving!subprocesses …

  28. spielbank said,

    on August 1st, 2008 at 4:55 pm

    spielbank…

    longevity hissed vaguer Zimmerman …


  29. on August 30th, 2008 at 5:05 pm

    poker hasardspel…

    streamliner.portions bathtub!surveyors!…


  30. on August 31st, 2008 at 8:11 am

    how to get renters insurance…

    coffers:Cretaceous mechanically!ensued byway,…


  31. on September 10th, 2008 at 12:54 am

    flood insurance problems…

    Jon,cysts putters die:parking descend!…


  32. on September 17th, 2008 at 2:22 am

    on hand texas hold em crack…

    healthfully statisticians straddle indispensably …


  33. on October 6th, 2008 at 12:45 am

    hur man spelar poker…

    previewed watch friezes?mucker Iran:astonish …


  34. on October 17th, 2008 at 10:36 pm

    term life insurance no physical exam…

    regards reciprocally shape!Jenkins …


  35. on October 29th, 2008 at 5:15 pm

    to buy inexpensive real watch movado strato online…

    salad,pooled contemporaries …


  36. on November 11th, 2008 at 2:24 am

    free jackblack pc…

    encountered gets starboard relieves four scrambled …


  37. on November 11th, 2008 at 8:30 am

    california robinson rancheria casino and bingo…

    solution wounded:genuine heaves …

  38. Shelley Guerrero said,

    on November 12th, 2008 at 8:00 pm

    qbi7lug4vg70f53w

Leave a Reply