Linux df command
Linux df command displays the current disk usage on a Linux system file system statistics.
grammar
df [选项]... [FILE]...
- File -a, --all include all of the file system with 0 Blocks
- File --block-size = {SIZE} {SIZE} use size Blocks
- File -h, --human-readable using a human-readable format (default is without this option ...)
- File -H, --si like -h, but use 1000 instead of 1024 as a unit
- File -i, --inodes lists inode information, not the use of block lists
- File -k, --kilobytes like --block-size = 1024
- File -l, file structure --local restrictions listed
- File -m, --megabytes like --block-size = 1048576
- --no-Sync files before access to information not sync (default)
- File -P, --portability use POSIX output format
- File --sync, before obtaining the information sync
- File -t, --type = TYPE limit listing the file system, TYPE
- File -T, --print-type display in the form of a file system
- File -x, --exclude-type = TYPE limit listing the file system not to show TYPE
- File -v (ignored)
- File --help display this help and exit
- File --version output version information and exit
Examples
Displays the file system's disk usage statistics:
# df Filesystem 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 file system name, the second column specifies a particular file system 1K- total memory block is 1024 1K bytes. Available with and columns are in use, specify the amount of memory.
Use column specifies the percentage of memory used, and the last bar "installed in the" mount point specified file system.
df can also display information on the disk file system used:
# df test Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda6 29640780 4320600 23814492 16% /
Df -i option to output a command to display inode information instead of block usage.
df -i Filesystem Inodes IUsed IFree IUse% Mounted on /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
Displays all information:
# df --total Filesystem 1K-blocks Used Available Use% Mounted on /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 total 33344320 4321772 27516860 14%
We see the end of the output, including an extra line shows the total of each column.
-h option, through which you can generate an output readable format df command:
# df -h Filesystem Size Used Avail Use% Mounted on /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
We can see the output displayed in digital form 'G' (gigabytes), "M" (megabytes) and "K" (kilobytes).
This makes the output easier to read and understand, so that the display readable. Note that the second column's name also changed, in order to display readable "size."