How to check the hard disk size under Linux system: First open the terminal in the Linux system; then enter the "df -h" command in the terminal to check the hard disk size and get how much space is occupied by the hard disk. Currently, How much space is left and other information.
[Recommended course: Linux Tutorial]
Commands to view hard disk size
df -h
The df command can obtain information such as how much space is occupied by the hard disk, how much space is currently left, etc. It can also display all file systems Usage of inodes and disk blocks.
The Df command is a Linux system that views the file system in units of disk partitions. You can add parameters to view the remaining disk space information. The command format is: df -hl
The display format is:
##/dev/hdb2 75G 75G 0 100% /
or above Take the output above as an example. It means:
df -hl 查看磁盘剩余空间 df -h 查看每个根路径的分区大小 du -sh [目录名] 返回该目录的大小 du -sm [文件夹] 返回该文件夹总M数 du -h [目录名] 查看指定文件夹下的所有文件大小(包含子文件夹)
For more functions, you can enter the command to view: View IDE hard disk information#sudo hdparm -i /dev/hda Check the remaining space on the hard disk#df -h #df -H Check the space occupied by the directory#du -hs directory name The USB flash drive is not there How to uninstall #sync fuser -km /media/usbdisk Summary: The above is the entire content of this article, I hope it will be helpful to everyone. The above is the detailed content of How to check the hard disk size in Linux system. For more information, please follow other related articles on the PHP Chinese website!df --help
du --help
View hard disk partitions#sudo fdisk -l
View STAT hard disk information #sudo hdparm -I /dev/sda or #sudo apt-get install blktool #sudo blktool /dev/sda id