df (Unix)

df (Unix)

df (abbreviation for disk free) is a standard Unix computer program used to display the amount of available disk space for filesystems on which the invoking user has appropriate read access. df is usually implemented by reading the mtab file or using statfs.

df first appeared in Version 1 AT&T UNIX.

Contents

Usage

The Single UNIX Specification specifications for df are:

 df [-k] [-P|-t] [-del] [file...]
-k
Use 1024-byte units, instead of the default 512-byte units, when writing space figures.
-P
Use a standard, portable, output format
-t
If XSI compliant, show allocated space as well[dubious ]
-h
Display in Kb, Mb, or Gb
file
Write the amount of free space of the file system containing the specified file

Most Unix and Unix-like operating systems add extra options. The BSD and GNU coreutils versions include -h, where free space is listed in human readable format, adding units with the appropriate SI prefix (e.g. 10MB), -i, listing inode usage, and -l, restricting display to only local filesystems. GNU df includes -T as well, listing filesystem type information, but the GNU df shows the sizes in 1K blocks by default.

Specification

The Single Unix Specification (SUS) specifies by default space is reported in blocks of 512 bytes, and that at a minimum, the file system names and the amount of free space.

The use of 512-byte units is historical practice and maintains compatibility with ls and other utilities. This does not mandate that the file system itself be based on 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 easily alias df to df -k without breaking many historical scripts relying on the 512-byte units.

The output with -P shall consist of one line of information for each specified file system. These lines shall be formatted as follows:

<fs name>, <total space>, <space used>, <space free>, <percentage used>, <fs root>

In the following list, all quantities expressed in 512-byte units (1024-byte when -k is specified) shall be rounded up to the next higher unit. The fields are:

<fs name>

The name of the file system, in an implementation-defined format.

<total space>

The total size of the file system in 512-byte units. The exact meaning of this figure is implementation-defined, but should include <space used>, <space free>, plus any space reserved by the system not normally available to a user.

<space used>

The total amount of space allocated to existing files in the file system, in 512-byte units.

<space free>

The total amount of space available within the file system for the creation of new files by unprivileged users, in 512-byte 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.

<percentage used>

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:

<space used> / (<space used>+ <space free>)

expressed as a percentage. This percentage may be greater than 100 if <space free> 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.

<fs root>

The directory below which the file system hierarchy appear

Example

 $ df -k
 Filesystem    1024-blocks      Free %Used    Iused %Iused Mounted on
 /dev/hd4            32768     16016   52%     2271    14% /usr
 /dev/hd2          4587520   1889420   59%    37791     4% /usr
 /dev/hd9var         65536     12032   82%      518     4% /var
 /dev/hd3           819200    637832   23%     1829     1% /tmp
 /dev/hd1           524288    395848   25%      421     1% /home
 /proc                   -         -    -         -     -  /proc
 /dev/hd10opt        65536     26004   61%      654     4% /opt

See also

  • List of Unix programs

External links

Manual pages


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать курсовую

Look at other dictionaries:

  • Unix — (officially trademarked as UNIX, sometimes also written as Unix with small caps) is a computer operating system originally developed in 1969 by a group of AT T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Douglas McIlroy, and… …   Wikipedia

  • UNIX — Ken Thompson und Dennis Ritchie Basisdaten Entwickler …   Deutsch Wikipedia

  • Unix — Kommandozeile (Unix Prompt) Basisdaten Entwickler Ken Thompso …   Deutsch Wikipedia

  • Unix — (registrado oficialmente como UNIX®) es un sistema operativo portable, multitarea y multiusuario; desarrollado, en principio, en 1969 por un grupo de empleados de los laboratorios Bell de AT T, entre los que figuran Ken Thompson, Dennis Ritchie y …   Wikipedia Español

  • UNIX — UNIX, parfois écrit « Unix », avec des petites capitales, est un système d exploitation multitâche et multi utilisateur créé en 1969, conceptuellement ouvert et fondé sur une approche par laquelle il offre de nombreux petits outils… …   Wikipédia en Français

  • Unix — (marque déposée officiellement comme UNIX, parfois aussi écrit comme Unix avec les petites capitalisations) est le nom d un système d exploitation multitâche et multi utilisateur créé en 1969, conceptuellement ouvert et fondé sur une approche par …   Wikipédia en Français

  • Unix time — Unix time, or POSIX time, is a system for describing points in time, defined as the number of seconds elapsed since midnight Coordinated Universal Time (UTC) of January 1 1970, not counting leap seconds. It is widely used not only on Unix like… …   Wikipedia

  • Unix-подобная операционная система — Генеалогическое дерево UNIX подобных ОС UNIX подобная операционная система (иногда сокр. *nix)  система, которая образовалась под влиянием UNIX. Термин включает свободные/открытые операционные системы, образованные от UNIX компании …   Википедия

  • UNIX — 〈[ju:nıx] EDV〉 Betriebssystem für Computer, das zum großen Teil in der Programmiersprache C geschrieben ist [engl.] * * * UNIX   [ursprünglich UNICS, Abk. für Uniplexed Information and Computing System, dt. »nicht multiplextes (vielseitiges)… …   Universal-Lexikon

  • UNIX-Kommandos — Unix Systeme zeichnen sich durch eine Vielzahl von Kommandos aus, mit denen sich über eine Shell das Betriebssystem bedienen lässt. Die Syntax dieser Kommandos weicht unter den verschiedenen Systemen voneinander ab. Es existieren die beiden… …   Deutsch Wikipedia

  • Unix-Befehle — Unix Systeme zeichnen sich durch eine Vielzahl von Kommandos aus, mit denen sich über eine Shell das Betriebssystem bedienen lässt. Die Syntax dieser Kommandos weicht unter den verschiedenen Systemen voneinander ab. Es existieren die beiden… …   Deutsch Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”