yossman.net - "du" unix command help
document first created 1997-10-07.
document last updated 2004-01-23.

the "du" command in unix tells you how much space a directory or set of directories and the files inside are taking up. let's say you want to know how much space you are taking up in your home directory, and all the subdirectories you've made off your home directory. you would simply log into your account, and as your first command, just type 'du'. the output will look something like this:
yossman.net# du
906     ./mail
8       ./.ncftp
1572    ./ircstuff
2       ./public_www
3543    .
yossman.net#
by default on yossman.net, the numbers from 'du' will be in kilobytes (1024 bytes). on some systems, the default is to show the sizes in '512 byte blocks', so the numbers will look approximately doubled. this readout tells me i have 900 kilobytes (900K) in my 'mail' directory, 2K in my 'public_www' directory, and so on. the final number, '3543', is pointing to the '.' directory, which is the current directory you are looking at. if you have just logged in, this is the total space your home directory and all of your subdirectories is taking up. in this case, it's telling me i have used 3543K, or approximately 3.46 megabytes (3.46MB).

you can execute this command from any directory to find out what the total amount of space that particular directory tree is taking up on the system. for more options to use with 'du', check the manpages for it (type 'man du').