Calculating directory sizes

Wednesday, March 02 2005 @ 05:44 PM EST

Contributed by: Admin

To see how big all your folders are, launch Terminal and enter du -sh ./*

Sample output:

355M	./Desktop
1.3M	./Documents
242M	./Library
116M	./Movies
283M	./Music
 33M	./Pictures
 24K	./Public
228K	./Sites
 44K	./bin
4.0K	./dev
195M	./safari-downloads
119M	./tmp
Explaination: du is 'disk usage,' -s means 'just for the files named' (otherwise it'll dig through and count every subdirectory and file) and -h means 'human readable'--it'll report in MB or GB or whatever is appropriate, rather than a gigantic number of kilobytes.

To see how much space all your users are using, use this command as an administrative user:
sudo du -sh /Users/*

You can also get a more detailed view--one level deeper--with this:
sudo du -sh /Users/*/*
For example:
 14M    /Users/admin/Desktop
344K    /Users/admin/Documents
 36M    /Users/admin/Library
  0B    /Users/admin/Movies
 24K    /Users/admin/Music
127M    /Users/admin/My Applications
  0B    /Users/admin/Pictures
142M    /Users/admin/Public
 28K    /Users/admin/Sites
1.4G    /Users/brian/Desktop
1.1M    /Users/brian/Documents
257M    /Users/brian/Library