背景
Linux中 df
命令的功能是用来检查 linux 服务器的文件系统的磁盘空间占用情况。可以利用该命令来获取硬盘被占用了多少空间,目前还剩下多少空间等信息。
命令格式:
df [选项] [文件]
命令功能:
df [选项] [文件]
显示指定磁盘文件的可用空间。如果没有文件名被指定,则所有当前被挂载的文件系统的可用空间将被显示。默认情况下,磁盘空间将以 1KB 为单位进行显示,除非环境变量 POSIXLY_CORRECT 被指定,那样将以512字节为单位进行显示
命令参数:
参数 | 详解 |
---|---|
-a | 全部文件系统列表 |
-h | 方便阅读方式显示 |
-H 等于“-h” | 但是计算式,1K=1000,而不是1K=1024 |
-i | 显示inode信息 |
-k | 区块为1024字节 |
-l | 只显示本地文件系统 |
-m | 区块为1048576字节 |
–no-sync | 忽略 sync 命令 |
-P | 输出格式为POSIX |
–sync | 在取得磁盘信息前,先执行sync命令 |
-T | 文件系统类型 |
–block-size=<区块大小> | 指定区块大小 |
-t<文件系统类型> | 只显示选定文件系统的磁盘信息 |
-x<文件系统类型> | 不显示选定文件系统的磁盘信息 |
–help | 显示帮助信息 |
–version | 显示版本信息 |
使用实例:
显示磁盘使用情况
命令:
df
输出:
[root@biostacs ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/CentOS-root 50G 44G 6.4G 88% /
devtmpfs 7.8G 0 7.8G 0% /dev
tmpfs 7.8G 0 7.8G 0% /dev/shm
tmpfs 7.8G 74M 7.7G 1% /run
tmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup
/dev/mapper/centos-home 1.8T 1.7T 110G 94% /home
/dev/sdb 1.8T 1.4T 373G 79% /home/storage2T
/dev/sda1 494M 230M 265M 47% /boot
tmpfs 1.6G 0 1.6G 0% /run/user/0
[root@biostacs ~]#
说明:
命令:
df
输出:
[root@biostacs ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/CentOS-root 50G 44G 6.4G 88% /
devtmpfs 7.8G 0 7.8G 0% /dev
tmpfs 7.8G 0 7.8G 0% /dev/shm
tmpfs 7.8G 74M 7.7G 1% /run
tmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup
/dev/mapper/centos-home 1.8T 1.7T 110G 94% /home
/dev/sdb 1.8T 1.4T 373G 79% /home/storage2T
/dev/sda1 494M 230M 265M 47% /boot
tmpfs 1.6G 0 1.6G 0% /run/user/0
[root@biostacs ~]#
说明:
df
[root@biostacs ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/CentOS-root 50G 44G 6.4G 88% /
devtmpfs 7.8G 0 7.8G 0% /dev
tmpfs 7.8G 0 7.8G 0% /dev/shm
tmpfs 7.8G 74M 7.7G 1% /run
tmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup
/dev/mapper/centos-home 1.8T 1.7T 110G 94% /home
/dev/sdb 1.8T 1.4T 373G 79% /home/storage2T
/dev/sda1 494M 230M 265M 47% /boot
tmpfs 1.6G 0 1.6G 0% /run/user/0
[root@biostacs ~]#
说明:
linux中 df
命令的输出清单的第1列是代表文件系统对应的设备文件的路径名(一般是硬盘上的分区);第2列给出分区包含的数据块(1024字节)的数目;第3,4列分别表示已用的和可用的数据块数目。用户也许会感到奇怪的是,第3,4列块数之和不等于第2列中的块数。这是因为缺省的每个分区都留了少量空间供系统管理员使用。即使遇到普通用户空间已满的情况,管理员仍能登录和留有解决问题所需的工作空间。清单中Use% 列表示普通用户空间使用的百分比,即使这一数字达到100%,分区仍然留有系统管理员使用的空间。最后,Mounted on列表示文件系统的挂载点。
以inode模式来显示磁盘使用情况
命令:
df -i
输出:
[root@CT1190 log]# df -i
[root@biostacs ~]# df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/mapper/centos-root 27257168 802560 26454608 3% /
devtmpfs 2026718 499 2026219 1% /dev
tmpfs 2030611 1 2030610 1% /dev/shm
tmpfs 2030611 635 2029976 1% /run
tmpfs 2030611 13 2030598 1% /sys/fs/cgroup
/dev/mapper/centos-home 378449088 978304 377470784 1% /home
/dev/sdb 122101760 38962 122062798 1% /home/storage2T
/dev/sda1 512000 344 511656 1% /boot
tmpfs 2030611 1 2030610 1% /run/user/0
显示指定类型磁盘
命令:
df -t ext3
输出:
[root@biostacs ~]# df -t xfs
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/centos-root 52403200 45793692 6609508 88% /
/dev/mapper/centos-home 1891321556 1776217420 115104136 94% /home
/dev/sda1 505580 235228 270352 47% /boot
列出各文件系统的i节点使用情况
命令:
df -ia
输出:
[root@www.linuxidc.com ~]# df -ia
Filesystem Inodes IUsed IFree IUse% Mounted on
rootfs - - - - /
sysfs 0 0 0 - /sys
proc 0 0 0 - /proc
devtmpfs 2026718 499 2026219 1% /dev
securityfs 0 0 0 - /sys/kernel/security
tmpfs 2030611 1 2030610 1% /dev/shm
devpts 0 0 0 - /dev/pts
tmpfs 2030611 635 2029976 1% /run
tmpfs 2030611 13 2030598 1% /sys/fs/cgroup
cgroup 0 0 0 - /sys/fs/cgroup/systemd
pstore 0 0 0 - /sys/fs/pstore
cgroup 0 0 0 - /sys/fs/cgroup/freezer
cgroup 0 0 0 - /sys/fs/cgroup/memory
cgroup 0 0 0 - /sys/fs/cgroup/blkio
cgroup 0 0 0 - /sys/fs/cgroup/hugetlb
cgroup 0 0 0 - /sys/fs/cgroup/cpu,cpuacct
cgroup 0 0 0 - /sys/fs/cgroup/cpuset
cgroup 0 0 0 - /sys/fs/cgroup/devices
cgroup 0 0 0 - /sys/fs/cgroup/net_cls
cgroup 0 0 0 - /sys/fs/cgroup/perf_event
configfs 0 0 0 - /sys/kernel/config
/dev/mapper/centos-root 27258128 802560 26455568 3% /
selinuxfs 0 0 0 - /sys/fs/selinux
systemd-1 - - - - /proc/sys/fs/binfmt_misc
debugfs 0 0 0 - /sys/kernel/debug
mqueue 0 0 0 - /dev/mqueue
hugetlbfs 0 0 0 - /dev/hugepages
sunrpc 0 0 0 - /var/lib/nfs/rpc_pipefs
nfsd 0 0 0 - /proc/fs/nfsd
/dev/mapper/centos-home 378449088 978304 377470784 1% /home
/dev/sdb 122101760 38962 122062798 1% /home/storage2T
/dev/sda1 512000 344 511656 1% /boot
binfmt_misc 0 0 0 - /proc/sys/fs/binfmt_misc
tmpfs 2030611 1 2030610 1% /run/user/0
列出文件系统的类型
命令:
df -T
输出:
[root@www.linuxidc.com ~]# df -T
Filesystem Type 1K-blocks Used Available Use% Mounted on
/dev/mapper/centos-root xfs 52403200 45793692 6609508 88% /
devtmpfs devtmpfs 8106872 0 8106872 0% /dev
tmpfs tmpfs 8122444 0 8122444 0% /dev/shm
tmpfs tmpfs 8122444 74756 8047688 1% /run
tmpfs tmpfs 8122444 0 8122444 0% /sys/fs/cgroup
/dev/mapper/centos-home xfs 1891321556 1776217420 115104136 94% /home
/dev/sdb ext4 1922721048 1434366872 390662064 79% /home/storage2T
/dev/sda1 xfs 505580 235228 270352 47% /boot
tmpfs tmpfs 1624492 0 1624492 0% /run/user/0
以更易读的方式显示目前磁盘空间和使用情况
df -i
输出:
[root@CT1190 log]# df -i
[root@biostacs ~]# df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/mapper/centos-root 27257168 802560 26454608 3% /
devtmpfs 2026718 499 2026219 1% /dev
tmpfs 2030611 1 2030610 1% /dev/shm
tmpfs 2030611 635 2029976 1% /run
tmpfs 2030611 13 2030598 1% /sys/fs/cgroup
/dev/mapper/centos-home 378449088 978304 377470784 1% /home
/dev/sdb 122101760 38962 122062798 1% /home/storage2T
/dev/sda1 512000 344 511656 1% /boot
tmpfs 2030611 1 2030610 1% /run/user/0
显示指定类型磁盘
命令:
df -t ext3
输出:
[root@biostacs ~]# df -t xfs
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/centos-root 52403200 45793692 6609508 88% /
/dev/mapper/centos-home 1891321556 1776217420 115104136 94% /home
/dev/sda1 505580 235228 270352 47% /boot
列出各文件系统的i节点使用情况
命令:
df -ia
输出:
[root@www.linuxidc.com ~]# df -ia
Filesystem Inodes IUsed IFree IUse% Mounted on
rootfs - - - - /
sysfs 0 0 0 - /sys
proc 0 0 0 - /proc
devtmpfs 2026718 499 2026219 1% /dev
securityfs 0 0 0 - /sys/kernel/security
tmpfs 2030611 1 2030610 1% /dev/shm
devpts 0 0 0 - /dev/pts
tmpfs 2030611 635 2029976 1% /run
tmpfs 2030611 13 2030598 1% /sys/fs/cgroup
cgroup 0 0 0 - /sys/fs/cgroup/systemd
pstore 0 0 0 - /sys/fs/pstore
cgroup 0 0 0 - /sys/fs/cgroup/freezer
cgroup 0 0 0 - /sys/fs/cgroup/memory
cgroup 0 0 0 - /sys/fs/cgroup/blkio
cgroup 0 0 0 - /sys/fs/cgroup/hugetlb
cgroup 0 0 0 - /sys/fs/cgroup/cpu,cpuacct
cgroup 0 0 0 - /sys/fs/cgroup/cpuset
cgroup 0 0 0 - /sys/fs/cgroup/devices
cgroup 0 0 0 - /sys/fs/cgroup/net_cls
cgroup 0 0 0 - /sys/fs/cgroup/perf_event
configfs 0 0 0 - /sys/kernel/config
/dev/mapper/centos-root 27258128 802560 26455568 3% /
selinuxfs 0 0 0 - /sys/fs/selinux
systemd-1 - - - - /proc/sys/fs/binfmt_misc
debugfs 0 0 0 - /sys/kernel/debug
mqueue 0 0 0 - /dev/mqueue
hugetlbfs 0 0 0 - /dev/hugepages
sunrpc 0 0 0 - /var/lib/nfs/rpc_pipefs
nfsd 0 0 0 - /proc/fs/nfsd
/dev/mapper/centos-home 378449088 978304 377470784 1% /home
/dev/sdb 122101760 38962 122062798 1% /home/storage2T
/dev/sda1 512000 344 511656 1% /boot
binfmt_misc 0 0 0 - /proc/sys/fs/binfmt_misc
tmpfs 2030611 1 2030610 1% /run/user/0
列出文件系统的类型
命令:
df -T
输出:
[root@www.linuxidc.com ~]# df -T
Filesystem Type 1K-blocks Used Available Use% Mounted on
/dev/mapper/centos-root xfs 52403200 45793692 6609508 88% /
devtmpfs devtmpfs 8106872 0 8106872 0% /dev
tmpfs tmpfs 8122444 0 8122444 0% /dev/shm
tmpfs tmpfs 8122444 74756 8047688 1% /run
tmpfs tmpfs 8122444 0 8122444 0% /sys/fs/cgroup
/dev/mapper/centos-home xfs 1891321556 1776217420 115104136 94% /home
/dev/sdb ext4 1922721048 1434366872 390662064 79% /home/storage2T
/dev/sda1 xfs 505580 235228 270352 47% /boot
tmpfs tmpfs 1624492 0 1624492 0% /run/user/0
以更易读的方式显示目前磁盘空间和使用情况
[root@CT1190 log]# df -i
[root@biostacs ~]# df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/mapper/centos-root 27257168 802560 26454608 3% /
devtmpfs 2026718 499 2026219 1% /dev
tmpfs 2030611 1 2030610 1% /dev/shm
tmpfs 2030611 635 2029976 1% /run
tmpfs 2030611 13 2030598 1% /sys/fs/cgroup
/dev/mapper/centos-home 378449088 978304 377470784 1% /home
/dev/sdb 122101760 38962 122062798 1% /home/storage2T
/dev/sda1 512000 344 511656 1% /boot
tmpfs 2030611 1 2030610 1% /run/user/0
命令:
df -t ext3
输出:
[root@biostacs ~]# df -t xfs
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/centos-root 52403200 45793692 6609508 88% /
/dev/mapper/centos-home 1891321556 1776217420 115104136 94% /home
/dev/sda1 505580 235228 270352 47% /boot
列出各文件系统的i节点使用情况
命令:
df -ia
输出:
[root@www.linuxidc.com ~]# df -ia
Filesystem Inodes IUsed IFree IUse% Mounted on
rootfs - - - - /
sysfs 0 0 0 - /sys
proc 0 0 0 - /proc
devtmpfs 2026718 499 2026219 1% /dev
securityfs 0 0 0 - /sys/kernel/security
tmpfs 2030611 1 2030610 1% /dev/shm
devpts 0 0 0 - /dev/pts
tmpfs 2030611 635 2029976 1% /run
tmpfs 2030611 13 2030598 1% /sys/fs/cgroup
cgroup 0 0 0 - /sys/fs/cgroup/systemd
pstore 0 0 0 - /sys/fs/pstore
cgroup 0 0 0 - /sys/fs/cgroup/freezer
cgroup 0 0 0 - /sys/fs/cgroup/memory
cgroup 0 0 0 - /sys/fs/cgroup/blkio
cgroup 0 0 0 - /sys/fs/cgroup/hugetlb
cgroup 0 0 0 - /sys/fs/cgroup/cpu,cpuacct
cgroup 0 0 0 - /sys/fs/cgroup/cpuset
cgroup 0 0 0 - /sys/fs/cgroup/devices
cgroup 0 0 0 - /sys/fs/cgroup/net_cls
cgroup 0 0 0 - /sys/fs/cgroup/perf_event
configfs 0 0 0 - /sys/kernel/config
/dev/mapper/centos-root 27258128 802560 26455568 3% /
selinuxfs 0 0 0 - /sys/fs/selinux
systemd-1 - - - - /proc/sys/fs/binfmt_misc
debugfs 0 0 0 - /sys/kernel/debug
mqueue 0 0 0 - /dev/mqueue
hugetlbfs 0 0 0 - /dev/hugepages
sunrpc 0 0 0 - /var/lib/nfs/rpc_pipefs
nfsd 0 0 0 - /proc/fs/nfsd
/dev/mapper/centos-home 378449088 978304 377470784 1% /home
/dev/sdb 122101760 38962 122062798 1% /home/storage2T
/dev/sda1 512000 344 511656 1% /boot
binfmt_misc 0 0 0 - /proc/sys/fs/binfmt_misc
tmpfs 2030611 1 2030610 1% /run/user/0
列出文件系统的类型
命令:
df -T
输出:
[root@www.linuxidc.com ~]# df -T
Filesystem Type 1K-blocks Used Available Use% Mounted on
/dev/mapper/centos-root xfs 52403200 45793692 6609508 88% /
devtmpfs devtmpfs 8106872 0 8106872 0% /dev
tmpfs tmpfs 8122444 0 8122444 0% /dev/shm
tmpfs tmpfs 8122444 74756 8047688 1% /run
tmpfs tmpfs 8122444 0 8122444 0% /sys/fs/cgroup
/dev/mapper/centos-home xfs 1891321556 1776217420 115104136 94% /home
/dev/sdb ext4 1922721048 1434366872 390662064 79% /home/storage2T
/dev/sda1 xfs 505580 235228 270352 47% /boot
tmpfs tmpfs 1624492 0 1624492 0% /run/user/0
以更易读的方式显示目前磁盘空间和使用情况
df -t ext3
[root@biostacs ~]# df -t xfs
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/centos-root 52403200 45793692 6609508 88% /
/dev/mapper/centos-home 1891321556 1776217420 115104136 94% /home
/dev/sda1 505580 235228 270352 47% /boot
列出各文件系统的i节点使用情况
命令:
df -ia
输出:
[root@www.linuxidc.com ~]# df -ia
Filesystem Inodes IUsed IFree IUse% Mounted on
rootfs - - - - /
sysfs 0 0 0 - /sys
proc 0 0 0 - /proc
devtmpfs 2026718 499 2026219 1% /dev
securityfs 0 0 0 - /sys/kernel/security
tmpfs 2030611 1 2030610 1% /dev/shm
devpts 0 0 0 - /dev/pts
tmpfs 2030611 635 2029976 1% /run
tmpfs 2030611 13 2030598 1% /sys/fs/cgroup
cgroup 0 0 0 - /sys/fs/cgroup/systemd
pstore 0 0 0 - /sys/fs/pstore
cgroup 0 0 0 - /sys/fs/cgroup/freezer
cgroup 0 0 0 - /sys/fs/cgroup/memory
cgroup 0 0 0 - /sys/fs/cgroup/blkio
cgroup 0 0 0 - /sys/fs/cgroup/hugetlb
cgroup 0 0 0 - /sys/fs/cgroup/cpu,cpuacct
cgroup 0 0 0 - /sys/fs/cgroup/cpuset
cgroup 0 0 0 - /sys/fs/cgroup/devices
cgroup 0 0 0 - /sys/fs/cgroup/net_cls
cgroup 0 0 0 - /sys/fs/cgroup/perf_event
configfs 0 0 0 - /sys/kernel/config
/dev/mapper/centos-root 27258128 802560 26455568 3% /
selinuxfs 0 0 0 - /sys/fs/selinux
systemd-1 - - - - /proc/sys/fs/binfmt_misc
debugfs 0 0 0 - /sys/kernel/debug
mqueue 0 0 0 - /dev/mqueue
hugetlbfs 0 0 0 - /dev/hugepages
sunrpc 0 0 0 - /var/lib/nfs/rpc_pipefs
nfsd 0 0 0 - /proc/fs/nfsd
/dev/mapper/centos-home 378449088 978304 377470784 1% /home
/dev/sdb 122101760 38962 122062798 1% /home/storage2T
/dev/sda1 512000 344 511656 1% /boot
binfmt_misc 0 0 0 - /proc/sys/fs/binfmt_misc
tmpfs 2030611 1 2030610 1% /run/user/0
列出文件系统的类型
命令:
df -T
输出:
[root@www.linuxidc.com ~]# df -T
Filesystem Type 1K-blocks Used Available Use% Mounted on
/dev/mapper/centos-root xfs 52403200 45793692 6609508 88% /
devtmpfs devtmpfs 8106872 0 8106872 0% /dev
tmpfs tmpfs 8122444 0 8122444 0% /dev/shm
tmpfs tmpfs 8122444 74756 8047688 1% /run
tmpfs tmpfs 8122444 0 8122444 0% /sys/fs/cgroup
/dev/mapper/centos-home xfs 1891321556 1776217420 115104136 94% /home
/dev/sdb ext4 1922721048 1434366872 390662064 79% /home/storage2T
/dev/sda1 xfs 505580 235228 270352 47% /boot
tmpfs tmpfs 1624492 0 1624492 0% /run/user/0
以更易读的方式显示目前磁盘空间和使用情况
df -ia
输出:
[root@www.linuxidc.com ~]# df -ia
Filesystem Inodes IUsed IFree IUse% Mounted on
rootfs - - - - /
sysfs 0 0 0 - /sys
proc 0 0 0 - /proc
devtmpfs 2026718 499 2026219 1% /dev
securityfs 0 0 0 - /sys/kernel/security
tmpfs 2030611 1 2030610 1% /dev/shm
devpts 0 0 0 - /dev/pts
tmpfs 2030611 635 2029976 1% /run
tmpfs 2030611 13 2030598 1% /sys/fs/cgroup
cgroup 0 0 0 - /sys/fs/cgroup/systemd
pstore 0 0 0 - /sys/fs/pstore
cgroup 0 0 0 - /sys/fs/cgroup/freezer
cgroup 0 0 0 - /sys/fs/cgroup/memory
cgroup 0 0 0 - /sys/fs/cgroup/blkio
cgroup 0 0 0 - /sys/fs/cgroup/hugetlb
cgroup 0 0 0 - /sys/fs/cgroup/cpu,cpuacct
cgroup 0 0 0 - /sys/fs/cgroup/cpuset
cgroup 0 0 0 - /sys/fs/cgroup/devices
cgroup 0 0 0 - /sys/fs/cgroup/net_cls
cgroup 0 0 0 - /sys/fs/cgroup/perf_event
configfs 0 0 0 - /sys/kernel/config
/dev/mapper/centos-root 27258128 802560 26455568 3% /
selinuxfs 0 0 0 - /sys/fs/selinux
systemd-1 - - - - /proc/sys/fs/binfmt_misc
debugfs 0 0 0 - /sys/kernel/debug
mqueue 0 0 0 - /dev/mqueue
hugetlbfs 0 0 0 - /dev/hugepages
sunrpc 0 0 0 - /var/lib/nfs/rpc_pipefs
nfsd 0 0 0 - /proc/fs/nfsd
/dev/mapper/centos-home 378449088 978304 377470784 1% /home
/dev/sdb 122101760 38962 122062798 1% /home/storage2T
/dev/sda1 512000 344 511656 1% /boot
binfmt_misc 0 0 0 - /proc/sys/fs/binfmt_misc
tmpfs 2030611 1 2030610 1% /run/user/0
列出文件系统的类型
命令:
df -T
输出:
[root@www.linuxidc.com ~]# df -T
Filesystem Type 1K-blocks Used Available Use% Mounted on
/dev/mapper/centos-root xfs 52403200 45793692 6609508 88% /
devtmpfs devtmpfs 8106872 0 8106872 0% /dev
tmpfs tmpfs 8122444 0 8122444 0% /dev/shm
tmpfs tmpfs 8122444 74756 8047688 1% /run
tmpfs tmpfs 8122444 0 8122444 0% /sys/fs/cgroup
/dev/mapper/centos-home xfs 1891321556 1776217420 115104136 94% /home
/dev/sdb ext4 1922721048 1434366872 390662064 79% /home/storage2T
/dev/sda1 xfs 505580 235228 270352 47% /boot
tmpfs tmpfs 1624492 0 1624492 0% /run/user/0
以更易读的方式显示目前磁盘空间和使用情况
[root@www.linuxidc.com ~]# df -ia
Filesystem Inodes IUsed IFree IUse% Mounted on
rootfs - - - - /
sysfs 0 0 0 - /sys
proc 0 0 0 - /proc
devtmpfs 2026718 499 2026219 1% /dev
securityfs 0 0 0 - /sys/kernel/security
tmpfs 2030611 1 2030610 1% /dev/shm
devpts 0 0 0 - /dev/pts
tmpfs 2030611 635 2029976 1% /run
tmpfs 2030611 13 2030598 1% /sys/fs/cgroup
cgroup 0 0 0 - /sys/fs/cgroup/systemd
pstore 0 0 0 - /sys/fs/pstore
cgroup 0 0 0 - /sys/fs/cgroup/freezer
cgroup 0 0 0 - /sys/fs/cgroup/memory
cgroup 0 0 0 - /sys/fs/cgroup/blkio
cgroup 0 0 0 - /sys/fs/cgroup/hugetlb
cgroup 0 0 0 - /sys/fs/cgroup/cpu,cpuacct
cgroup 0 0 0 - /sys/fs/cgroup/cpuset
cgroup 0 0 0 - /sys/fs/cgroup/devices
cgroup 0 0 0 - /sys/fs/cgroup/net_cls
cgroup 0 0 0 - /sys/fs/cgroup/perf_event
configfs 0 0 0 - /sys/kernel/config
/dev/mapper/centos-root 27258128 802560 26455568 3% /
selinuxfs 0 0 0 - /sys/fs/selinux
systemd-1 - - - - /proc/sys/fs/binfmt_misc
debugfs 0 0 0 - /sys/kernel/debug
mqueue 0 0 0 - /dev/mqueue
hugetlbfs 0 0 0 - /dev/hugepages
sunrpc 0 0 0 - /var/lib/nfs/rpc_pipefs
nfsd 0 0 0 - /proc/fs/nfsd
/dev/mapper/centos-home 378449088 978304 377470784 1% /home
/dev/sdb 122101760 38962 122062798 1% /home/storage2T
/dev/sda1 512000 344 511656 1% /boot
binfmt_misc 0 0 0 - /proc/sys/fs/binfmt_misc
tmpfs 2030611 1 2030610 1% /run/user/0
命令:
df -T
输出:
[root@www.linuxidc.com ~]# df -T
Filesystem Type 1K-blocks Used Available Use% Mounted on
/dev/mapper/centos-root xfs 52403200 45793692 6609508 88% /
devtmpfs devtmpfs 8106872 0 8106872 0% /dev
tmpfs tmpfs 8122444 0 8122444 0% /dev/shm
tmpfs tmpfs 8122444 74756 8047688 1% /run
tmpfs tmpfs 8122444 0 8122444 0% /sys/fs/cgroup
/dev/mapper/centos-home xfs 1891321556 1776217420 115104136 94% /home
/dev/sdb ext4 1922721048 1434366872 390662064 79% /home/storage2T
/dev/sda1 xfs 505580 235228 270352 47% /boot
tmpfs tmpfs 1624492 0 1624492 0% /run/user/0
以更易读的方式显示目前磁盘空间和使用情况
df -T
[root@www.linuxidc.com ~]# df -T
Filesystem Type 1K-blocks Used Available Use% Mounted on
/dev/mapper/centos-root xfs 52403200 45793692 6609508 88% /
devtmpfs devtmpfs 8106872 0 8106872 0% /dev
tmpfs tmpfs 8122444 0 8122444 0% /dev/shm
tmpfs tmpfs 8122444 74756 8047688 1% /run
tmpfs tmpfs 8122444 0 8122444 0% /sys/fs/cgroup
/dev/mapper/centos-home xfs 1891321556 1776217420 115104136 94% /home
/dev/sdb ext4 1922721048 1434366872 390662064 79% /home/storage2T
/dev/sda1 xfs 505580 235228 270352 47% /boot
tmpfs tmpfs 1624492 0 1624492 0% /run/user/0
以更易读的方式显示目前磁盘空间和使用情况
命令:
df -h #1M=1024KB
df -H #1M=1000KB
df -lh
df -k
输出:
[root@master ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 591G 219G 342G 40% /
devtmpfs 16G 0 16G 0% /dev
tmpfs 16G 84K 16G 1% /dev/shm
tmpfs 16G 122M 16G 1% /run
tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/mapper/ddf1_BIOSTACS1 28G 218M 26G 1% /boot
/dev/mapper/centos-home 1.2T 321G 816G 29% /home
tmpfs 3.2G 16K 3.2G 1% /run/user/42
192.168.122.5:/home/bio/data1/data 1.8T 843G 898G 49% /home/bio/data1/data
192.168.122.5:/home/bio/data2/data 1.8T 1.3T 460G 74% /home/bio/data2/data
192.168.122.5:/home/bio/data3/data 1.9T 1.2T 726G 62% /home/bio/data3/data
192.168.122.5:/home/bio/data4/data 551G 550G 0 100% /home/bio/data4/data
tmpfs 3.2G 0 3.2G 0% /run/user/0
[root@master ~]# df -H
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 634G 235G 368G 40% /
devtmpfs 17G 0 17G 0% /dev
tmpfs 17G 87k 17G 1% /dev/shm
tmpfs 17G 128M 17G 1% /run
tmpfs 17G 0 17G 0% /sys/fs/cgroup
/dev/mapper/ddf1_BIOSTACS1 30G 228M 28G 1% /boot
/dev/mapper/centos-home 1.3T 345G 876G 29% /home
tmpfs 3.4G 17k 3.4G 1% /run/user/42
192.168.122.5:/home/bio/data1/data 2.0T 905G 965G 49% /home/bio/data1/data
192.168.122.5:/home/bio/data2/data 2.0T 1.4T 494G 74% /home/bio/data2/data
192.168.122.5:/home/bio/data3/data 2.0T 1.3T 779G 62% /home/bio/data3/data
192.168.122.5:/home/bio/data4/data 591G 591G 0 100% /home/bio/data4/data
tmpfs 3.4G 0 3.4G 0% /run/user/0
[root@master ~]# df -lh
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 591G 219G 342G 40% /
devtmpfs 16G 0 16G 0% /dev
tmpfs 16G 84K 16G 1% /dev/shm
tmpfs 16G 122M 16G 1% /run
tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/mapper/ddf1_BIOSTACS1 28G 218M 26G 1% /boot
/dev/mapper/centos-home 1.2T 321G 816G 29% /home
tmpfs 3.2G 16K 3.2G 1% /run/user/42
tmpfs 3.2G 0 3.2G 0% /run/user/0
[root@master ~]# df -k
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/centos-root 619140256 229199524 358467068 40% /
devtmpfs 16352484 0 16352484 0% /dev
tmpfs 16367828 84 16367744 1% /dev/shm
tmpfs 16367828 124148 16243680 1% /run
tmpfs 16367828 0 16367828 0% /sys/fs/cgroup
/dev/mapper/ddf1_BIOSTACS1 28705700 222496 27001988 1% /boot
/dev/mapper/centos-home 1255303728 336432740 855081932 29% /home
tmpfs 3273568 16 3273552 1% /run/user/42
192.168.122.5:/home/bio/data1/data 1922720768 883601408 941427712 49% /home/bio/data1/data
192.168.122.5:/home/bio/data2/data 1922720768 1343306752 481722368 74% /home/bio/data2/data
192.168.122.5:/home/bio/data3/data 1952561152 1192248320 760312832 62% /home/bio/data3/data
192.168.122.5:/home/bio/data4/data 576731136 576714752 0 100% /home/bio/data4/data
tmpfs 3273568 0 3273568 0% /run/user/0
说明:
[root@master ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 591G 219G 342G 40% /
devtmpfs 16G 0 16G 0% /dev
tmpfs 16G 84K 16G 1% /dev/shm
tmpfs 16G 122M 16G 1% /run
tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/mapper/ddf1_BIOSTACS1 28G 218M 26G 1% /boot
/dev/mapper/centos-home 1.2T 321G 816G 29% /home
tmpfs 3.2G 16K 3.2G 1% /run/user/42
192.168.122.5:/home/bio/data1/data 1.8T 843G 898G 49% /home/bio/data1/data
192.168.122.5:/home/bio/data2/data 1.8T 1.3T 460G 74% /home/bio/data2/data
192.168.122.5:/home/bio/data3/data 1.9T 1.2T 726G 62% /home/bio/data3/data
192.168.122.5:/home/bio/data4/data 551G 550G 0 100% /home/bio/data4/data
tmpfs 3.2G 0 3.2G 0% /run/user/0
[root@master ~]# df -H
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 634G 235G 368G 40% /
devtmpfs 17G 0 17G 0% /dev
tmpfs 17G 87k 17G 1% /dev/shm
tmpfs 17G 128M 17G 1% /run
tmpfs 17G 0 17G 0% /sys/fs/cgroup
/dev/mapper/ddf1_BIOSTACS1 30G 228M 28G 1% /boot
/dev/mapper/centos-home 1.3T 345G 876G 29% /home
tmpfs 3.4G 17k 3.4G 1% /run/user/42
192.168.122.5:/home/bio/data1/data 2.0T 905G 965G 49% /home/bio/data1/data
192.168.122.5:/home/bio/data2/data 2.0T 1.4T 494G 74% /home/bio/data2/data
192.168.122.5:/home/bio/data3/data 2.0T 1.3T 779G 62% /home/bio/data3/data
192.168.122.5:/home/bio/data4/data 591G 591G 0 100% /home/bio/data4/data
tmpfs 3.4G 0 3.4G 0% /run/user/0
[root@master ~]# df -lh
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 591G 219G 342G 40% /
devtmpfs 16G 0 16G 0% /dev
tmpfs 16G 84K 16G 1% /dev/shm
tmpfs 16G 122M 16G 1% /run
tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/mapper/ddf1_BIOSTACS1 28G 218M 26G 1% /boot
/dev/mapper/centos-home 1.2T 321G 816G 29% /home
tmpfs 3.2G 16K 3.2G 1% /run/user/42
tmpfs 3.2G 0 3.2G 0% /run/user/0
[root@master ~]# df -k
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/centos-root 619140256 229199524 358467068 40% /
devtmpfs 16352484 0 16352484 0% /dev
tmpfs 16367828 84 16367744 1% /dev/shm
tmpfs 16367828 124148 16243680 1% /run
tmpfs 16367828 0 16367828 0% /sys/fs/cgroup
/dev/mapper/ddf1_BIOSTACS1 28705700 222496 27001988 1% /boot
/dev/mapper/centos-home 1255303728 336432740 855081932 29% /home
tmpfs 3273568 16 3273552 1% /run/user/42
192.168.122.5:/home/bio/data1/data 1922720768 883601408 941427712 49% /home/bio/data1/data
192.168.122.5:/home/bio/data2/data 1922720768 1343306752 481722368 74% /home/bio/data2/data
192.168.122.5:/home/bio/data3/data 1952561152 1192248320 760312832 62% /home/bio/data3/data
192.168.122.5:/home/bio/data4/data 576731136 576714752 0 100% /home/bio/data4/data
tmpfs 3273568 0 3273568 0% /run/user/0
参数 | 详解 |
---|---|
-h | 根据目前磁盘空间和使用情况 以更易读的方式显示 |
-H | 和上面的-h参数相同,不过在根式化的时候,采用1000而不是1024进行容量转换 |
-k | 以单位显示磁盘的使用情况 |
-l | 显示本地的分区的磁盘空间使用率,如果服务器nfs了远程服务器的磁盘,那么在df上加上-l后系统显示的是过滤nsf驱动器后的结果 |
-i | 显示inode的使用情况。linux 采用了类似指针的方式管理磁盘空间影射.这也是一个比较关键应用 |
本文永久更新链接地址:http://www.linuxidc.com/Linux/2017-06/144945.htm