df 8.25 命令詳解


展示 FILE 所在的文件係統 (或默認情況下的所有文件係統) 信息。

另請參閱: cd     mkdir

基本語法     基本用法     詳細用法

df [OPTION]... [FILE]...
			

注意:長選項強製性自變量,對於短選項也是強製性的。

SIZE 格式

顯示值以來自 --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

FIELD_LIST 是要包括列的逗號分隔列錶。

有效字段名稱: source fstype itotal iused iavail ipcent size used avail pcent file target

選項參數

參數 EN 解釋 中文翻譯 備注
-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 輸齣版本信息並退齣

基本用法

功能 命令 說明 備注
查看 df -h 以 1024 的冪為單位打印尺寸 如 60K、500M、21G
幫助 df --help 展示幫助信息
版本 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:~#
			

 

版權聲明: 本文為獨傢原創稿件,版權歸 樂數軟件 ,未經許可不得轉載。