df命令

df - report file system disk space usage 显示文件系统磁盘空间使用情况

 

语法:

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

 

描述:

 

df displays the amount of disk space available on the file system

If no file name is given, the space available on all currently mounted file systems is shown.

Disk space is shown in 1K blocks by default, 显示的是块的个数(默认块大小为1K)

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

 

If an argument is the absolute file name of a disk device node(containing a mounted file system), df shows the space available on that file system

rather than on the file system containing the device node (which is always the root file system).

如果参数是设备节点(包含一个已装载的文件系统)的绝对文件名,df命令显示的是那个文件系统(而不是root文件系统可得到的空间

This version of df cannot show the space available on unmounted file systems, 该版本不能显示未装载文件系统的可得空间

because on most kinds of systems doing so requires very nonportable intimate knowledge of对。。。有深入的认识 file system structures.

因为各文件系统的结构通常不一样

 

选项:

Show information about the file system on which each FILE resides, or all file systems by default.

显示文件系统的信息(默认显示所有文件系统),每个文件都在文件系统上面,

 

 

Mandatory arguments to long options are mandatory for short options too.对于长选项的强制参数,对于短选项同样是强制的。

 

-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.

 

Filesystem      1M-blocks Used         Available     Use%     Mounted on

/dev/sda1 39089600      12664308 24416616     35%         /

/dev/sda1 38174M      12368M 23845M     35%         /

39089600/1024 = 38173.43

12664308/1024 = 12367.48

24416616/1024 = 23844.35 可以看出小数向上取整

 

--total

produce a grand total 产生一个总计

-h, --human-readable

print sizes in human readable format (e.g., 1K 234M 2G)

-H, --si

likewise, but use powers of 1000 not 1024

 

-i, --inodes

list inode information instead of block usage -- 列出inode的信息而不是块的使用

 

-k like --block-size=1K

 

-l, --local

limit listing to local file systems

 

-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.

 

-P, --portability

use the POSIX output format

 

--sync invoke 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)

 

--help display this help and exit

 

--version

output version information and exit

 

Display values are in units of the first available SIZE from --block-size, and the DF_BLOCK_SIZE, BLOCK_SIZE and BLOCKSIZE environment variables.

显示的值,以第一个可得到的SIZE为单位,从df_block_size, block_size, blocksize环境变量

Otherwise, units default to 1024 bytes (or 512 if POSIXLY_CORRECT is set). 否则,默认单位是1024字节(即以1K为单位显示)

 

SIZE is an integer and optional unit (example: 10M is 10*1024*1024). SIZE是一个整数,可以是任意单位,比如SIZE值为10M即以10*1024*1024个字节为单位

Units are K, M, G, T, P, E, Z, Y (powers of 1024) or KB, MB, ... (powers of 1000).

 

FIELD_LIST is a comma-separated list of columns to be included.

Valid field names are: 'source', 'fstype', 'itotal', 'iused', 'iavail', 'ipcent', 'size', 'used', 'avail', 'pcent' and 'target' (see info page).

AUTHOR

Written by Torbjorn Granlund, David MacKenzie, and Paul Eggert.

 

REPORTING BUGS

Report df bugs to bug-coreutils@gnu.org

GNU coreutils home page: <http://www.gnu.org/software/coreutils/>

General help using GNU software: <http://www.gnu.org/gethelp/>

Report df translation bugs to <http://translationproject.org/team/>

 

COPYRIGHT

Copyright © 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.

This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

 

SEE ALSO

The full documentation for df is maintained as a Texinfo manual. If the info and df programs are properly installed at your site, the command

 

info coreutils 'df invocation'

 

should give you access to the complete manual.

posted @ 2015-07-10 17:44  asnjudy  阅读(738)  评论(0编辑  收藏  举报