Thursday, December 20, 2012

Find User With Most Diskspace Used Using Linux Quotas

This will show the entire quota table sorted in descending order:
repquota  -a  | grep '\-\- ' | sort -rn -k 3 | more

If you aren't running quotas, you can still find the user by going into /home and using:
du -m --max-depth=1 | sort -rn

The results will be in MegaBytes. Note that using this method can take a long time to run on larger filesystems with many users.