cli - df

最後更新: 2022-08-31

df - report file system disk space usage

 


# Filesystem usage

df [Path]

Filesystem      1K-blocks       Used Available Use% Mounted on
tmpfs             1638460       1348   1637112   1% /run
/dev/sda3        10218772    3853928   5824172  40% /
...

Remark

[1]

Disk space is shown in 1K blocks by default,(-B, --block-size=SIZE)
(Unit: K,M,G,T,P,E,Z,Y)

unless the environment variable POSIXLY_CORRECT is set, in which case 512-byte blocks are used.

[2]

"Path" 是接受 Device 或 Mountpoint 的

ie.

df /dev/sda3

Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/sda3       10218772 3853932   5824168  40% /

df /

Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/sda3       10218772 3853932   5824168  40% /

# Filesystem 的 inodes usage

df -i

Filesystem        Inodes   IUsed     IFree IUse% Mounted on
tmpfs            2048074     852   2047222    1% /run
/dev/sda3         655360  123315    532045   19% /
...

 

# Useful Opts

-h, --human-readable

--output[=FIELD_LIST]    # comma-separated list
                                      # 'source',  'fstype', 'size', 'used', 'avail', 'pcent', 'file' and 'target'
                                      # 'itotal', 'iused', 'iavail', 'ipcent'

 

 

 

Creative Commons license icon Creative Commons license icon