How To: Check OS X Disk Usage
In OS X there are two ways to do everything. Via the GUI, or Via the command line. Frequently the GUI method does fine for most uses. But sometimes a bit more information is needed.
In the GUI, getting Disc Usage is simple. Open Finder, click on the drive and look at the bottom of the finder window. The number of files selected and the space available is displayed. But, this only shows the current directory and includes ALL sub folders under it.
But with a little use of the command line we can get a lot more information. Opening terminal defaults to the active user’s home directory.
At this point type du -sh * We’re adding the s for “Display an entry for each specified file,” and h for “Human-readable” output.
This will give a readout like this:
As can be seen this then gives a readout of each directory in the current one and provides the total space it takes up. In cases of low hard drive space this gives a good way to quickly find folders that may be too big. It could also be run in the /Users folder on multi-user machines to find out who it using all the hard drive space.
3 thoughts on “How To: Check OS X Disk Usage”
Hi, I tried this command. I'm kind of a newbie, so I want to tell you the steps I took to make sure I did them correctly. In Finder, I went to applications, utilities, and opened terminal.app. At the prompt I typed du -sh. This is the result:
du: ./Library/Application Support/Google/Google Desktop/Index/9DFD0548-7F1A-4DEE-9DD9-9E37A411D3F6.trindex: Permission denied
Can you please tell me what I did wrong or how to get the desired disk usage allocation? Please respond to my email address if possible. Thanks, Mark.
Not really an error, merely that directory can not be read due to permissions. Try adding the sudo command to the front.
thus: sudo du -sh
Then enter your admin user's name and password.
Thanks for that Rick, worked perfectly and gave me just the info I required. I thought I was going to have to buy an application to do this