du

Format:

du options directory

Options:

-a Display sizes for every file, not only directories
-s Display the grand total only

Du prints the disk usage in 512 blocks. It is used mainly to print out the sizes of directories.

					$ pwd 
/var 
$ du -s 
14929   .
				

The size of the /var directory structure is 14929 (512) blocks.

Get Linux and Unix Shell Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.