first : Overall situation of Unified Disk , Include disk size , Used , available
1. View current directory
command
df -h
result :
Unify the overall situation of disks in each directory
2. View the specified directory
Put the directory name directly after the command , For example, check “usr” Directory usage :
df -h /usr/
result :
Unified the usage of specified directory I , And the maximum space allocated
second : Check the usage of folders .
1. View the status of each folder in the current directory .
command :
du --max-depth=1 -h
give the result as follows :
The last line counts the total number of disks occupied
2. Specify directory
As long as the root directory name is directly after the command , In table of contents “/usr” take as an example
The command is as follows :
du --max-depth=1 -h /usr/
give the result as follows :
third : Calculate folder size
For quick display , At the same time, I just want to see the overall occupation size of the directory . Can be used directly du -sh command , If you want to view the specified directory , Directly in the root directory after the command .
command :
du -sh /usr/
give the result as follows :
fourth : summary
among df -h and du -sh More used , One statistics of the overall disk situation , A look at the use of individual directory points , And command du --max-depth=1 -h
Checked the usage of folders in the directory , Less use , It can be used du -sh replace , And the command is long , Of course, it's not that it's useless .
Technology
Daily Recommendation