Du (Unix)

Du (Unix)

du (abbreviated from "disk usage") is a standard Unix program used to estimate the file space usage; space used under a particular directory or files on a file system.

History

The du utility first appeared in version 1 of AT&T UNIX.

Specification

By default, the Single Unix Specification (SUS) specifies that du is to display the file space allocated to each file and directory contained in the current directory. Links will be displayed as the size of the link file, not what is being linked to; the size of the content of directories is displayed, as expected.

As du reports allocation space and not absolute file space, the amount of space on a file system shown by du may vary from that shown by df if files have been deleted but their blocks not yet freed.

Usage

du takes a single argument, specifying a pathname for du to work; if it is not specified, the current directory is used. The SUS mandates for du the following options:: -a, display an entry for each file (and not directory) contained in the current directory: -H, calculate disk usage for link references specified on the command line: -k, show sizes as multiples of 1024 bytes, not 512-byte : -L, calculate disk usage for link references anywhere: -s, report only the sum of the usage in the current directory, not for each file: -x, only traverse files and directories on the device on which the pathname argument is specified.: -h, show filesize in human readable format.

Other Unix and Unix-like operating systems may add extra options. For example, BSD and GNU du specify a -h option, displaying disk usage in a format easier to read by the user, adding units with the appropriate SI prefix (eg. 10 MB). GNU du however conflicts with the SUS specification by using the short -H option to display binary prefixes instead.

Examples

Sum of directories in kilobytes: $ du -sk * 2800344 directoryOne 4270554 directoryTwo

$ du -skh * 2.8M directoryOne 4.2M directoryTwodisk usage of all subdirectories and files including hidden files within the current directory (sorted by filesize) : $ du -sk . [A-z] * *|sort -n

The weight of directories: $ du -d 1 -c -h

ee also

*List of Unix programs
*Filelight
*Baobab

External links

* [http://www.opengroup.org/onlinepubs/009695399/utilities/du.html du] — specification from the Single Unix Specification

Manual pages

* [http://www.gnu.org/software/coreutils/manual/html_node/du-invocation.html du] — manual page from GNU coreutils
* [http://www.openbsd.org/cgi-bin/man.cgi?query=du du] — manual page from OpenBSD
* [http://leaf.dragonflybsd.org/cgi/web-man?command=du&section=ANY du] — manual page from Dragonflybsd

Other

* [http://www.bellevuelinux.org/du.html The du Command] by The Linux Information Project (LINFO)
* [http://freshmeat.net/search/?q=disk+space Disk space-related utilities] at Freshmeat.net


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”