linux中的df命令的功能:報告文件系統正在使用的可用磁盤空間量html
描述:node
df顯示包含每一個文件名參數的文件系統上可用的磁盤空間量。若是未給出文件名,則會顯示全部當前安裝的文件系統上可用的空間。磁盤空間默認顯示爲1 K塊,除非設置了環境變量POSIXLY_CORRECT,在這種狀況下使用512字節的塊。 linux
若是參數是包含已裝入文件系統的磁盤設備節點的絕對文件名,則df將顯示該文件系統上可用的空間,而不是包含設備節點(始終是根文件系統)的文件系統上的可用空間。 df沒法顯示未安裝的文件系統上可用的空間,由於在大多數系統上這樣作須要系統特定的文件系統結構知識。oop
語法:spa
df [OPTION] ... [FILE]orm
選項: htm
-a, --all
Include dummy 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 for more information.
--total
Display a grand total.
-h, --human-readable
Print sizes in human readable format (e.g., 1K 234M 2G).
-H, --si
Same as -h, but use powers of 1000 instead of 1024.
-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 a sync before getting usage info, which is the default setting.
-P, --portability
Use the POSIX output format.
--sync
Invoke a sync before getting usage info.
-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; included for compatibility reasons.
--help
Display a help message and exit.
--version
Output version information and exit.
SIZE格式:get
顯示值以--block-size和DF_BLOCK_SIZE,BLOCK_SIZE和BLOCKSIZE環境變量中的第一個可用SIZE爲單位。不然,單位默認爲1024字節(若是設置POSIXLY_CORRECT,則爲512)。 SIZE是一個整數和可選單位(例如:10M是10 * 1024 * 1024)。單位是K,M,G,T,P,E,Z,Y(1024的冪)或KB,MB,...(1000的冪)。it
df 例子:
df
Display all file systems and their disk usage, as in the following output:
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/loop0 18761008 15246876 2554440 86% /
none 4 0 4 0% /sys/fs/cgroup
udev 493812 4 493808 1% /dev
tmpfs 100672 1364 99308 2% /run
none 5120 0 5120 0% /run/lock
none 503352 1764 501588 1% /run/shm
none 102400 20 102380 1% /run/user
/dev/sda3 174766076 164417964 10348112 95% /host
df -h
Same as above, but use "human readable" formatting, as in the following example:
Filesystem Size Used Avail Use% Mounted on
/dev/loop0 18G 15G 2.5G 86% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
udev 483M 4.0K 483M 1% /dev
tmpfs 99M 1.4M 97M 2% /run
none 5.0M 0 5.0M 0% /run/lock
none 492M 1.8M 490M 1% /run/shm
none 100M 20K 100M 1% /run/user
/dev/sda3 167G 157G 9.9G 95% /host
df public_html
Display the amount of free space in the public_html directory, as in the following output:
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/loop0 18761008 15246924 2554392 86% /