HOME

TheInfoList



OR:

df, short for ''disk free'', is a
shell Shell may refer to: Architecture and design * Shell (structure), a thin structure ** Concrete shell, a thin shell of concrete, usually with no interior columns or exterior buttresses Science Biology * Seashell, a hard outer layer of a marine ani ...
command Command may refer to: Computing * Command (computing), a statement in a computer language * command (Unix), a Unix command * COMMAND.COM, the default operating system shell and command-line interpreter for DOS * Command key, a modifier key on A ...
for reporting the amount of available storage space on file systems on which the
user Ancient Egyptian roles * User (ancient Egyptian official), an ancient Egyptian nomarch (governor) of the Eighth Dynasty * Useramen, an ancient Egyptian vizier also called "User" Other uses * User (computing), a person (or software) using an ...
has read access. is typically implemented using the or
system call In computing, a system call (syscall) is the programmatic way in which a computer program requests a service from the operating system on which it is executed. This may include hardware-related services (for example, accessing a hard disk drive ...
s. 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 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 Unix System V (pronounced: "System Five") is one of the first commercial versions of the Unix operating system. It was originally developed by AT&T and first released in 1983. Four major versions of System V were released, numbered 1, 2, 3, an ...
(versus the mixed 512/1024-byte usage on
BSD The Berkeley Software Distribution (BSD), also known as Berkeley Unix or BSD Unix, is a discontinued Unix operating system developed and distributed by the Computer Systems Research Group (CSRG) at the University of California, Berkeley, beginni ...
systems), and that a 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 to without breaking many historical scripts relying on the 512-byte units. The output with consists of one line of information for each specified file system, like: where: ; :The name of the file system, in an implementation-defined format. ; :The total size of the file system in block size units. The exact meaning of this figure is implementation-defined, but should include , , plus any space reserved by the system not normally available to a user. ; :The total amount of space allocated to existing files in the file system, in block size units. ; :The total amount of space available within the file system for the creation of new files by unprivileged users, in block size units. When this figure is less than or equal to zero, it shall not be possible to create any new files on the file system without first deleting others, unless the process has appropriate privileges. The figure written may be less than zero. ; :The percentage of the normally available space that is currently allocated to all files on the file system. This shall be calculated using the fraction: :: :expressed as a percentage. This percentage may be greater than 100 if is less than zero. The percentage value shall be expressed as a positive integer, with any fractional result causing it to be rounded to the next highest integer. ; :The directory below which the file system hierarchy appears


History

The command first appeared in Version 1 AT&T Unix. The command is part of the
X/Open X/Open group (also known as the Open Group for Unix Systems and incorporated in 1987 as X/Open Company, Ltd.) was a consortium founded by several European UNIX systems manufacturers in 1984 to identify and promote open standards in the field of info ...
Portability Guide since issue 2 of 1987. It was inherited into the first version of
POSIX The Portable Operating System Interface (POSIX; ) is a family of standards specified by the IEEE Computer Society for maintaining compatibility between operating systems. POSIX defines application programming interfaces (APIs), along with comm ...
and the
Single Unix Specification The Single UNIX Specification (SUS) is a standard for computer operating systems, compliance with which is required to qualify for using the "UNIX" trademark. The standard specifies programming interfaces for the C language, a command-line shell, ...
(SUS). The implementation of bundled in
GNU GNU ( ) is an extensive collection of free software (394 packages ), which can be used as an operating system or can be used in parts with other operating systems. The use of the completed GNU tools led to the family of operating systems popu ...
coreutils The GNU Core Utilities or coreutils is a collection of GNU software that implements many standard, Unix-based shell commands. The utilities generally provide POSIX compliant interface when the environment variable is set, but otherwise offers ...
was written by Torbjorn Granlund, David MacKenzie, and Paul Eggert. The command is available for
Windows Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
via
UnxUtils UnxUtils is a collection of utility programs that provide popular Unix-based shell commands ported from GNU implementations as native Windows programs that depend only on Win32 and the Microsoft C- runtime ( msvcrt.dll). The collection wa ...
.


Use

SUS specifies syntax: df k -t
del Del, or nabla, is an operator used in mathematics (particularly in vector calculus) as a vector differential operator, usually represented by the nabla symbol ∇. When applied to a function defined on a one-dimensional domain, it denotes ...
ile... ; :Use 1024-byte units, instead of the default 512-byte units, when writing space figures ; :Use a standard, portable, output format ; :Select the storage for the file system containing the specified file Most implementations include extra options. The
BSD The Berkeley Software Distribution (BSD), also known as Berkeley Unix or BSD Unix, is a discontinued Unix operating system developed and distributed by the Computer Systems Research Group (CSRG) at the University of California, Berkeley, beginni ...
and
GNU coreutils The GNU Core Utilities or coreutils is a collection of GNU software that implements many standard, Unix-based shell commands. The utilities generally provide POSIX compliant interface when the environment variable is set, but otherwise offers a ...
versions include (
human-readable In computing, a human-readable medium or human-readable format is any encoding of data or information that can be naturally read by humans, resulting in human-readable data. It is often encoded as ASCII or Unicode text, rather than as binary da ...
) which selects to format sizes in
metric units Metric units are units based on the metre, gram or second and decimal (power of ten) multiples or sub-multiples of these. According to Schadow and McDonald, metric units, in general, are those units "defined 'in the spirit' of the metric system, ...
(e.g. 10 MB), which lists
inode An inode (index node) is a data structure in a Unix-style file system that describes a file-system object such as a file or a directory. Each inode stores the attributes and disk block locations of the object's data. File-system object attribu ...
usage, and which restricts reporting to local filesystems. The
GNU GNU ( ) is an extensive collection of free software (394 packages ), which can be used as an operating system or can be used in parts with other operating systems. The use of the completed GNU tools led to the family of operating systems popu ...
implementation includes which includes filesystem type information.


Examples

Example output from the command: $ df Filesystem 1K-blocks Used Available Use% Mounted on udev 48764976 0 48764976 0% /dev tmpfs 9757068 173100 9583968 2% /run /dev/sda2 1824504008 723009800 1008791744 42% / tmpfs 48785328 0 48785328 0% /dev/shm tmpfs 5120 0 5120 0% /run/lock tmpfs 48785328 0 48785328 0% /sys/fs/cgroup /dev/sda1 523248 3672 519576 1% /boot/efi $ df -i Filesystem Inodes IUsed IFree IUse% Mounted on udev 12191244 500 12190744 1% /dev tmpfs 12196332 702 12195630 1% /run /dev/sda2 115859456 2583820 113275636 3% / tmpfs 12196332 1 12196331 1% /dev/shm tmpfs 12196332 5 12196327 1% /run/lock tmpfs 12196332 16 12196316 1% /sys/fs/cgroup /dev/sda1 0 0 0 - /boot/efi $ df -h Filesystem Size Used Avail Use% Mounted on udev 47G 0 47G 0% /dev tmpfs 9.4G 170M 9.2G 2% /run /dev/sda2 1.7T 690G 963G 42% / tmpfs 47G 0 47G 0% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 47G 0 47G 0% /sys/fs/cgroup /dev/sda1 511M 3.6M 508M 1% /boot/efi


See also

* *


References


External links

*


Manual pages


df
— manual page from
GNU GNU ( ) is an extensive collection of free software (394 packages ), which can be used as an operating system or can be used in parts with other operating systems. The use of the completed GNU tools led to the family of operating systems popu ...
coreutils The GNU Core Utilities or coreutils is a collection of GNU software that implements many standard, Unix-based shell commands. The utilities generally provide POSIX compliant interface when the environment variable is set, but otherwise offers ...
*
The df Command
– by The Linux Information Project (LINFO) {{Core Utilities commands Standard Unix programs Unix SUS2008 utilities