2020-01-23
linux
00
请注意,本文编写于 1924 天前,最后修改于 540 天前,其中某些信息可能已经过时。

目录

df
使用
语法
实例
参数

df

df(英文 : disk free)命令用于显示目前在linux系统上的文件系统磁盘使用情况统计

使用

所有使用者

语法

df [-ahitpx]... [file]...

实例

显示文件系统以易阅读的方式(会以M\G\K显示)查看磁盘使用情况统计

shell
df -h

显示文件系统的inode信息

shell
df -i

显示全部信息

shell
df --total

参数

常用参数 df -h
-a 或 --all 包括全部0blocks的文件系统
-B 或 --block-size=SIZE 在打印之前按 SIZE 缩放尺寸;
例如。'-BM' 以 1,048,576 字节为单位打印大小; 请参阅下面的 SIZE 格式
-h 或 --human-readable 方便人类阅读,以 1024 的幂输出(例如 1023M)
-H 或 --si 同样,但使用 1000 的幂而不是 1024
-i 或 --inodes 列出 inode 信息而不是块使用情况
-k 或 --block-size=1K
-l --local 限制列表到本地文件系统 --no-sync 在获取使用信息之前不调用同步(默认)
--output[=FIELD_LIST] 使用FIELD_LIST定义的输出格式, 如果省略 FIELD_LIST,则打印所有字段。
-p 或 --portability 使用POSIX输出格式
--sync 在获取使用信息之前调用同步
--total 删除所有对可用空间无关紧要的条目, 并产生总计
-t 或 --type=TYPE 限制列出 TYPE 类型的文件系统
-T 或 --print-type 打印文件系统类型
-x 或 --exclude-type=TYPE 限制列出非 TYPE 类型的文件系统
-v 忽略
--help 显示帮助并退出
--version 输出版本信息并退出

原文

-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
-h, --human-readable print sizes in powers of 1024 (e.g., 1023M)
-H, --si print sizes in powers of 1000 (e.g., 1.1G)
-i, --inodes list inode information instead of block usage
-k like --block-size=1K
-l, --local limit listing to local file systems
--no-sync do not invoke sync before getting usage info (default)
--output[=FIELD_LIST] use the output format defined by FIELD_LIST, or print all fields if FIELD_LIST is omitted.
-P, --portability use the POSIX output format
--sync invoke sync before getting usage info
--total elide all entries insignificant to available space, and produce a grand total
-t, --type=TYPE limit listing to file systems of type TYPE
-T, --print-type print file system type
-x, --exclude-type=TYPE limit listing to file systems not of type TYPE
-v (ignored)
--help display this help and exit
--version output version information and exit

注:

  1. df (GNU coreutils) 8.30
  2. 单位默认为 1024 字节
  3. SIZE 参数是一个整数和可选单位(例如:10K 是 10*1024)。 单位是 K、M、G、T、P、E、Z、Y(1024 的幂)或 KB、MB、...(1000 的幂)。