Linux Comm Df
[ Linux Command Manual](#)
The Linux `df` (short for **display free disk space**) command is used to display disk space usage for file systems, including total capacity, used space, available space, and mount points.
### Syntax
df ... ...
| Parameter | Description |
| --- | --- |
| **`-a`**, `--all` | Show all file systems, including pseudo file systems (like `proc`, `sysfs`) |
| **`-B`**, `--block-size=SIZE` | Specify display unit (e.g., `-BK`=KB, `-BM`=MB, `-BG`=GB) |
| **`-h`**, `--human-readable` | Display in human-readable format (auto-convert units: K, M, G, T, based on 1024) |
| **`-H`**, `--si` | Similar to `-h`, but uses 1000 as the conversion unit (SI standard) |
| **`-i`**, `--inodes` | Show inode usage (instead of disk space) |
| **`-k`** | Display in 1KB blocks (default unit) |
| **`-m`** | Display in 1MB blocks (supported on some systems) |
| **`-l`**, `--local` | Show only local file systems (exclude network file systems like NFS) |
| **`--no-sync`** | Do not call `sync` before getting information (default behavior) |
| **`--sync`** | Call `sync` before getting information (ensures data is up-to-date) |
| **`--total`** | Display a total summary line |
| **`-t`**, `--type=TYPE` | Show only file systems of the specified type (e.g., `ext4`, `xfs`) |
| **`-T`**, `--print-type` | Print the file system type |
| **`-x`**, `--exclude-type=TYPE` | Exclude file systems of the specified type |
| **`-P`**, `--portability` | Use POSIX-compatible output format (avoids line-wrapping issues) |
| **`--output=FIELD_LIST`** | Customize output fields (e.g., `source,fstype,size,pcent`) |
| **`--help`** | Display help information |
| **`--version`** | Display version information |
### Examples
Display disk usage statistics for file systems:
# 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
**Explanation:**
* `Filesystem`: The name or identifier of the file system.
* `1K-blocks`: Total capacity of the file system, in 1KB blocks. This is the total size of the file system.
* `Used`: Capacity already used by the file system, in 1KB blocks.
* `Available`: Capacity still available in the file system, in 1KB blocks.
* `Use%`: Percentage of the total capacity that has been used.
* `Mounted on`: The directory or location where the file system is mounted.
The `-h` option displays disk space usage in a human-readable format:
# 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
`df` can also display file system information for a specific path:
# df test Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda6 29640780 4320600 23814492 16% /
The output of a `df` command with the `-i` option displays 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
Display 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 can see at the end of the output, there is an extra line showing the total for each column.
We can see the output displays numbers with 'G' (gigabytes), 'M' (megabytes), and 'K' (kilobytes).
[ Linux Command Manual](#)
YouTip