You can display the size of directories by using the du command and options. Additionally, you can find the amount of disk space used by user accounts on local UFS file systems by using the quot command. For more information about these commands, see du(1) and quot(1M).
The du command displays the size of the directory you specify as well as all the subdirectories. You can use the command with the following options:
–a – displays the size of each file and subdirectory, and the total number of blocks that are contained in the specified directory.
–s – displays the total number of blocks that are contained in the specified directory.
–H – displays the size of each directory in 1000–byte blocks.
Use the following command syntax:
$ du [options] [directory1 directory2 ...]
The following example shows the size of /var/adm and its subdirectories:
$ du /var/adm 2 /var/adm/acct/nite 2 /var/adm/acct/sum 8 /var/adm/acct 2 /var/adm/sa 2 /var/adm/sm.bin 258 /var/adm
To compare sizes of different directories, specify those directories in the command. The following example shows the comparison of sizes between /var/adm and /var/spool/lp.
$ du /var/adm /var/spool/lp 2 /var/adm/acct/nite 2 /var/adm/acct/sum 8 /var/adm/acct 2 /var/adm/sa 2 /var/adm/sm.bin 258 /var/adm 4 /var/spool/lp/admins 2 /var/spool/lp/requests/printing.... 4 /var/spool/lp/requests 4 /var/spool/lp/system 2 /var/spool/lp/fifos 24 /var/spool/lp
The following example shows directory sizes in 1024–byte blocks:
$ du -h /usr/share/audio 796K /usr/share/audio/samples/au 797K /usr/share/audio/samples 798K /usr/share/audio