展示 FILE 所在的文件系统 (或默认情况下的所有文件系统) 信息。
基本语法 Basic Usage Detailed Usage
df [OPTION]... [FILE]...
注意:长选项强制性自变量,对于短选项也是强制性的。
显示值以来自 --block-size 的第一个可用 SIZE,及 DF_BLOCK_SIZE、 BLOCK_SIZE、 BLOCKSIZE 环境变量为单位。
否则, 单位默认为 1024 字节 (若 512 字节, 若设置了 POSIXLY_CORRECT)。
SIZE 自变量是整数且可选单位 (例如:10K 是 10 * 1024)。
单位为 K M G T P E Z Y (1024 的幂) 或 KB MB ... (1000 的幂)。
FIELD_LIST 是要包括列的逗号分隔列表。
有效字段名称: source fstype itotal iused iavail ipcent size used avail pcent file target
选项参数
| 参数 | EN 解释 | 中文翻译 | Remark |
|---|---|---|---|
| -a, --all | include pseudo, duplicate, inaccessible file systems | 包括伪 重复 不可访问的文件系统 | |
| -B, --block-size=SIZE |
scale sizes by SIZE before printing them; e.g., '-BM' prints sizes in units of 1,048,576 bytes; see SIZE format below |
在打印它们之前按 SIZE 缩放尺寸; 例如,-BM 以 1,048,576 字节为单位打印尺寸; 见 SIZE 格式 |
|
| -h, --human-readable | print sizes in powers of 1024 (e.g., 1023M) | 以 1024 的幂为单位打印尺寸 (例如 1023M) | |
| -H, --si | print sizes in powers of 1000 (e.g., 1.1G) | 以 1000 的幂为单位打印尺寸 (例如 1.1G) | |
| -i, --inodes | list inode information instead of block usage | 列出索引节点信息,而不是块使用情况 | |
| -k | like --block-size=1K | 像 --block-size=1K | |
| -l, --local | limit listing to local file systems | 把列表限制到本地文件系统 | |
| --no-sync | do not invoke sync before getting usage info (default) | 在获取使用情况信息之前不援引 sync (默认) | |
| --output[=FIELD_LIST] |
use the output format defined by FIELD_LIST, or print all fields if FIELD_LIST is omitted. |
使用由 FIELD_LIST 定义的输出格式, 或打印所有字段,若 FIELD_LIST 被省略。 |
|
| -P, --portability | use the POSIX output format | 使用 POSIX 输出格式 | |
| --sync | invoke sync before getting usage info | 在获取使用情况信息之前,援引 sync | |
| --total |
elide all entries insignificant to available space, and produce a grand total |
省略所有对可用空间无关紧要的条目, 并产生累计 |
|
| -t, --type=TYPE | limit listing to file systems of type TYPE | 把列表限制到 TYPE 类型的文件系统 | |
| -T, --print-type | print file system type | 打印文件系统类型 | |
| -x, --exclude-type=TYPE | limit listing to file systems not of type TYPE | 把列表限制到非 TYPE 类型的文件系统 | |
| -v | (ignored) | (忽略) | |
| --help | display this help and exit | 显示此帮助并退出 | |
| --version | output version information and exit | 输出版本信息并退出 |
| Function | 命令 | Explanation | Remark |
|---|---|---|---|
| 查看 | df -h | 以 1024 的幂为单位打印尺寸 | 如 60K、500M、21G |
| 帮助 | df --help | 展示帮助信息 | |
| Version | df --version | 展示版本信息 |
以 1024 的幂为单位,查看所有文件系统信息
root:~# df -h Filesystem Size Used Avail Use% Mounted on udev 225M 0 225M 0% /dev tmpfs 49M 2.7M 47M 6% /run /dev/vda1 40G 23G 15G 61% / tmpfs 244M 0 244M 0% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 244M 0 244M 0% /sys/fs/cgroup tmpfs 49M 0 49M 0% /run/user/1000 tmpfs 49M 0 49M 0% /run/user/0 root:~#
以 1024 的幂为单位,查看 ext4 类型文件系统信息
root:~# df -ht ext4 Filesystem Size Used Avail Use% Mounted on /dev/vda1 40G 23G 15G 61% / root:~#
Copyright Notice: This article is an exclusive original manuscript, copyright belongs to Happy Digits Software , shall not be reproduced without permission.