|Skip Navigation Links|
|Exit Print View|
|Oracle Solaris Administration: Common Tasks Oracle Solaris 11 Information Library|
You can display the size of directories by using the du command and options. For more information about these commands, see the du(1) man page.
$ du [-as] [directory ...]
Displays the size of each directory that you specify, including each subdirectory beneath it.
Displays the size of each file and subdirectory, and the total number of blocks that are contained in the specified directory.
Displays the total number of blocks that are contained in the specified directory.
Displays the size of each directory in 1024–byte blocks.
Displays the size of each directory in 1000–byte blocks.
Identifies one or more directories that you want to check. Separate multiple directories in the command-line syntax with spaces.
Example 13-8 Displaying the Size of Directories, Subdirectories, and Files
The following example shows the sizes of two directories.
$ du -s /var/adm /var/spool/cups 7098 /var/adm 0 /var/spool/cups
The following example shows the sizes of two directories and includes the sizes of all the subdirectories and files that are contained within each directory. The total number of blocks that are contained in each directory is also displayed.
$ du /var/adm /var/spool/cups 3 /var/adm/streams 3 /var/adm/sa 3 /var/adm/acct/fiscal 3 /var/adm/acct/nite 3 /var/adm/acct/sum 12 /var/adm/acct 3 /var/adm/exacct 3 /var/adm/sm.bin 3 /var/adm/log 3 /var/adm/pool 7098 /var/adm
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