df
DF can view the file system in units of disk partitions to obtain information such as how much space is occupied by the hard drive and how much space is currently left.
For example, we use the df - h command to view disk information- The h option is displayed appropriately based on size:
Display content parameter description:
Filesystem: file system
Size: Partition size
Used: Used capacity
Avail: Capacity that can still be used
Use%: Used percentage
Mounted on: Mount point
Related commands:
df -hl: Check the remaining disk space
df -h: View the partition size of each root path
Du sh [directory name]: returns the size of the directory
Du sm [folder]: returns the total number of M in the folder
Du - h [directory name]: View all file sizes (including subfolders) in the specified folder
du
The original English meaning of 'du' is disk usage, which displays the usage of disk space and is used to view the total size of the current directory.
For example, to check the size of the current directory:
# du -sh
605M .
Display the space occupied by the specified file:
# du log2012.log
300 log2012.log
Display the space occupied by the test directory in a format that is easy to read:
# du -h test
608K test/test6
308K test/test4
4.0K test/scf/lib
4.0K test/scf/service/deploy/product
4.0K test/scf/service/deploy/info
12K test/scf/service/deploy
16K test/scf/service
4.0K test/scf/doc
4.0K test/scf/bin
32K test/scf
8.0K test/test3
1.3M test
The 'du' command is used to view the total size of the current directory:
-s: Only provide the total number of occupied data blocks for each Names parameter.
-a: Recursively display the number of data blocks occupied by each file in the specified directory and subdirectories. If neither - s nor - a is specified, only the number of disk blocks occupied by each directory and its subdirectories in Names will be displayed.
-b: List disk space usage in bytes (the system defaults to k bytes).
-k: List disk space usage in units of 1024 bytes.
-c: Finally, add a total (system default setting).
-l: Calculate all file sizes, and for hard linked files, calculate multiple times.
-x: Skipping directories on different file systems will not be counted.
-h: Improve the readability of information in units of K, M, and G.
- linux, 硬盘, 磁盘空间, 查看硬盘, linux查看磁盘使用
- 0 Users Found This Useful