磁盘与存储CLI Manual
$df
Report file system disk space usage across mounted storage partitions.
命令语法POSIX Standard
df [OPTIONS] [FILE...]在交互式终端沙盒中实时运行
无需安装的客户端实时仿真环境。
bash — terminal
AST Sandbox (Free)
概述与工作原理
`df` (Disk Free) analyzes mounted filesystems to display total disk capacity, used space, available free space, and mount points. It is the first command sysadmins run when encountering "No space left on device" errors.
常用参数与选项说明
| Flag / Option | Description |
|---|---|
| -h, --human-readable | Print sizes in human-readable powers of 1024 (e.g., 10G, 500M). |
| -T, --print-type | Include filesystem type column (ext4, xfs, btrfs, tmpfs). |
| -i, --inodes | Display inode usage statistics instead of block usage. |
实际生产案例与代码范例
#1Check human-readable disk space
df -hDisplays disk usage for all mounted partitions with readable GB/MB units.