(阅读时间5s)查看当前机器磁盘空间及占用量,命令为df,如下
[root@localhost]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/cl-root 52403200 30371168 22032032 58% /
devtmpfs 65775924 0 65775924 0% /dev
tmpfs 65795872 0 65795872 0% /dev/shm
tmpfs 65795872 18168 65777704 1% /run
tmpfs 65795872 0 65795872 0% /sys/fs/cgroup
/dev/sda1 1038336 216480 821856 21% /boot
而用于挂载的查看可用的硬盘空间是fdisk -ls,不一样
[root@localhost]# fdisk -ls
Disk /dev/sdd: 1199.7 GB, 1199705161728 bytes, 2343174144 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes