Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Find users that use the most disk space UNIX
Find which users take up the most disk space. This can of course be used to indentify any number of users so I picked 10 as an arbitrary number.

If you are already root (unlikely, but possible) you can remove the sudo -s part. Here's the command:
sudo -s du -sm /Users/* | sort -nr | head -n 10
Generally you would have to make sure that you use sudo -s or it will give a few Permission denied errors before finally spitting out the results, and they may be incorrect. The directory structure should start with the /Users Directory and then it will recursively perform the operation. This may miss any folders outside of the normal user space, but there shouldn't normally be any user data there.

[crarko adds: I tested this, and it works as described. There are third party utilities that will give the same results with a GUI, but this is pretty handy to have for use on remote machines over an ssh connection. It can take a while to complete, so be patient. Also I noticed in Activity Monitor the du process was using a lot of cpu, so it's best to do this while not running other cpu (or I suppose disk) intensive programs.]
  • Currently 2.45 / 5
  You rated: 4 / 5 (11 votes cast)

Find users that use the most disk space | 4 comments | Create New Account
Click here to return to the 'Find users that use the most disk space' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Find users that use the most disk space
Authored by: Auricchio on Apr 11, '13 08:34:21AM

Notwithstanding the usefulness of this hint, are we now going to cite every combination of unix commands that provides useful results?

OmniGroup's free OmniDiskSweeper works nearly as fast as these unix commands, doesn't require root privileges, and shows everything on the system ranked by size---in color for quick reading.

The program also can delete items, immediately recomputing the new sizes.

(I have no association with OmniGroup except as a user of their products.)

EMOJO: mojo no longer workin'
Edited on Apr 11, '13 08:40:51AM by Auricchio

[ Reply to This | # ]
Find users that use the most disk space
Authored by: slb on Apr 11, '13 09:24:30AM

Or, are we going to have to suffer b*tching about what hints are useful? If you don't like it or find it useful, then ignore. I guess you missed the point about using over SSL for instance? Spare us the griping...

[ Reply to This | # ]
Find users that use the most disk space
Authored by: jaydisc on Apr 11, '13 06:48:10PM

This hint doesn't require root access any more than OmniDiskSweeper does. They both need you to be an admin and authenticate. Otherwise, they would not be able to calculate the stores of other users.

Personally, I'd just use:

sudo du -hxd1 /Users

Edited on Apr 11, '13 06:48:49PM by jaydisc

[ Reply to This | # ]
Find users that use the most disk space
Authored by: andya on Apr 12, '13 08:54:54AM

by SSL i assume you mean SSH...

[ Reply to This | # ]