Nowadays, many technical personnel like to use Linux system website servers. Using Linux system is more secure and efficient, but the capacity of our website server itself is certain, so we need to check the usage of Linux disk space. The following is This article will introduce to you how to check disk space in Linux. I hope it will be helpful to you.
#In Linux, you can use the df command to view disk space. The df command can be used to check the disk space usage in the Linux file system, that is, the disk usage. (Recommended learning: linux video tutorial)
Grammar
1 |
|
Command parameters:
● -a, --all Include all systems with 0 Blocks
● --block-size={SIZE} Use {SIZE} sized Blocks
● -h, --human -readable Use human readable format (the default value is not to add this option...)
● -H, --si is like -h, but uses 1000 as the unit instead of 1024
● -i, --inodes List inode information, do not list used blocks
● -k, --kilobytes Just like --block-size=1024
● -l, --local Limit the listed file structure
● -m, --megabytes Like --block-size=1048576
● --no-sync Get No sync before information (default)
● -P, --portability Use POSIX output format
● --sync Sync before getting information
● -t , --type=TYPE Limit the TYPE of the listed file system
● -T, --print-type Display the form of the file system
● -x, --exclude-type=TYPE Restrict listing of file systems to do not show TYPE
● -v (ignore)
● --help Display this helper and exit
● --version Print version information and exit
How to use the df command to check disk space?
If used without any arguments, the df command will display information about all mounted file systems:
1 |
|
Output:
1 2 3 4 5 6 7 |
|
Each line includes information about the file system name (Filesystem), size (1K-blocks), used space (Used), available space (Available), used space percentage (Use%), and the directories within the file system. Mounted on.
By default, the df command displays disk space in units of 1 KB and displays the size of used disk space and available disk space in kilobytes. This is very inconvenient, How to display disk space usage in human readable format (megabytes and gigabytes)?
To view the information in human-readable format (megabytes and gigabytes), pass the following -h option:
1 |
|
Output:
1 2 3 4 5 6 7 8 |
|
For more Linux-related technical knowledge, please visit the linux operation and maintenance column to learn!
The above is the detailed content of What is the command to check disk space in Linux?. For more information, please follow other related articles on the PHP Chinese website!