Checking directories size on linux
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
-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.
Comments:
Date: 03/19/2008 at 12:53:13
Poster: AC
from the du man page: --max-depth=0 is the same as --summarize
In other words, no, --max-depth=1 is not the same as -s
Date: 12/28/2007 at 06:46:13
Poster: Totenmond
Correct me if iīm wrong, but isnīt "--max-depth=1" the same as "-s"?




