English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The Linux df command (full name in English: disk free) is used to display statistics of file system disk usage on the current Linux system.
df [options]... [FILE]...
Display statistics of disk usage of the file system:
# df 文件系统 1K-blocks Used Available Use% Mounted on /dev/sda6 29640780 4320704 23814388 16% / udev 1536756 4 1536752 1% /dev tmpfs 617620 888 616732 1% /run none 5120 0 5120 0% /run/lock none 1544044 156 1543888 1% /run/shm
The first column specifies the name of the file system, and the second column specifies a specific file system1K-block1K is1024Total memory in bytes. The columns "used" and "available" specify the amount of memory in use.
Use the column to specify the percentage of memory used, while the last column "mounted on" specifies the mount point of the file system.
df也可以显示磁盘使用的文件系统信息:
# df test 文件系统 1K-块 已用 可用 使用% 挂载于 /dev/sda6 29640780 4320600 23814492 16% /
用一个-i选项的df命令输出显示索引节点信息而非块使用量。
df -i 文件系统 索引节点 已用 可用 使用% 挂载于 /dev/sda6 1884160 261964 1622196 14% / udev 212748 560 212188 1% /dev tmpfs 216392 477 215915 1% /run none 216392 3 216389 1% /run/lock none 216392 8 216384 1% /run/shm
显示所有信息:
# df --总计 文件系统 1K-块 已用 可用 使用% 挂载于 /dev/sda6 29640780 4320720 23814372 16% / udev 1536756 4 1536752 1% /dev tmpfs 617620 892 616728 1% /run none 5120 0 5120 0% /run/lock none 1544044 156 1543888 1% /run/shm 总计 33344320 4321772 27516860 14%
我们看到输出的末尾,包含一个额外的行,显示每一列的总计。
-h选项,通过它可以产生可读格式的df命令输出:
# df -h 文件系统 大小 已用 可用 使用% 挂载于 /dev/sda6 29G 4.2G 23G 16% / udev 1.5G 4.0K 1.5G 1% /dev tmpfs 604M 892K 603M 1% /run none 5.0M 0 5.0M 0% /run/lock none 1.5G 156K 1.5G 1% /run/shm
我们可以看到输出显示的数字形式的'G'(千兆字节),"M"(兆字节)和"K"(千字节)。
这使得输出易于阅读和理解,从而使显示可读。请注意,第二列的名称也发生了变化,为了使显示可读的“大小”。