![]() Example usage of df | |
Original author(s) | Ken Thompson, Dennis Ritchie (AT&T Bell Laboratories) |
---|---|
Developer(s) | Various open-source and commercial developers |
Initial release | 3 November 1971 |
Operating system | Unix, Unix-like |
Platform | Cross-platform |
Type | Command |
License | coreutils: GPLv3+ |
df
, short for disk free, is a shell command for reporting the amount of available storage space on file systems on which the user has read access. df
is typically implemented using the statfs()
or statvfs()
system calls.
The Single Unix Specification (SUS) specifies that space is reported in blocks of 512 bytes, and that at a minimum, it reports the file system names and the amount of free space.
Using 512-bytes as the unit of measure is a historical practice and maintains compatibility with ls
and other commands. Notably, the file system need not be constrained to internally use 512-byte blocks. The -k
option was added as a compromise measure. It was agreed by the standard developers that 512 bytes was the best default unit because of its complete historical consistency on System V (versus the mixed 512/1024-byte usage on BSD systems), and that a -k
option to switch to 1024-byte units was a good compromise. Users who prefer the more logical 1024-byte quantity can use alias
to map df
to df -k
without breaking many historical scripts relying on the 512-byte units.
The output with -P
consists of one line of information for each specified file system, like:
⟨fs name⟩ ⟨total space⟩ ⟨space used⟩ ⟨space free⟩ ⟨percentage used⟩ ⟨fs root⟩
where:
© MMXXIII Rich X Search. We shall prevail. All rights reserved. Rich X Search