# Directory size
Admin @ 06 July 2006
To check how much users uses space on linux box, simply use du command.
Recently I needed to show report for my boss, how much space used by users’ in a particular server.
As all user data stored in /home directory, I just executed such command:
# du -h –max-depth=1 /home > report.txt
# mail -s ‘User disk usage report’ boss@workplace.dom < report.txt
# rm -f report.txt
# mail -s ‘User disk usage report’ boss@workplace.dom < report.txt
# rm -f report.txt
-h parameter means to output in human readable format, append a size letter, such as M for binary megabytes.
–max-depth=1 means, that I need to output only directories with user names (I dont need to show users’ subdirectories).
Of course subdirectories are counted, just not shown.
Report has been written in report.txt file, then sent to my boss by mail with subject User disk usage report.
