DU is the short form of Disk Usage.

The linux du command is used to find out the disk usage in terms of file size and in human readable format. It can be used to get the size of the folders and the total disk usage. The usage of the command DU is very easy and some of them are explained below.

Pasted below are some usages of DU command.

1. Basic usage of du

The command du -a is used to get the disk usage of all the files and directories.

2. Display output in human readable format

The command du -h is used to print the information in human readable format.

3. Display grand total of the space usage in the output.

The command du -c is used to get the grand total of the disk usage.

4. Display only the total count of the disk usage

The command du -s is used to get the total amount of the disk usage.

5. Customize the block

The output can be produced in such a way that the disk usage of the files and the directories are dispalyed in the basis of the block size. In the defualt setting, it displays the block size as KB(1024 Bytes). It can be changed to a different block size depending on the need.

When change the block size to 2048(2KB), the output will be the following.

6. Display output in bytes

The command du -b is used to display the output in bytes.

7. Exclude particular types of file(s)

The command du –exclude is used to not displaying the information about a particular type of the file or files in the output.

When using the du -exclude command the output will be as follows

8. Display the modification time and customize the display style

The above can be done using the command du -time and du -time-style commands.