The du
command is a useful tool for displaying disk usage information in Unix. Here are a few examples of how you can use the du
command:
du
command without any options:du
This will output a list of the directories and files in the current directory, along with the amount of disk space they are using. The sizes are displayed in kilobytes by default.
du
command. For example, to display the disk usage of the /var
directory, you can use the following command:du /var
This will output a list of the directories and files in the /var
directory, along with the amount of disk space they are using.
-s
option to summarize the disk usage of each directory. For example:du -s
This will output the total disk usage of the current directory and its subdirectories, rather than listing the disk usage of each individual file and directory.
Overall, the du
command is a useful tool for displaying disk usage information in Unix. It has many other options and features that allow you to customize its behavior and output.