UNIX Disk Usage Command Examples

https://‮l.www‬autturi.com
UNIX Disk Usage Command Examples

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:

  • To display the disk usage of the current directory and its subdirectories, you can run the 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.

  • To display the disk usage of a specific directory and its subdirectories, you can specify the path to the directory as an argument to the 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.

  • To display the total disk usage of the current directory and its subdirectories, you can use the -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.

Created Time:2017-10-30 14:27:22  Author:lautturi