<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.tbpindustries.com/index.php?action=history&amp;feed=atom&amp;title=Du</id>
	<title>Du - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.tbpindustries.com/index.php?action=history&amp;feed=atom&amp;title=Du"/>
	<link rel="alternate" type="text/html" href="https://wiki.tbpindustries.com/index.php?title=Du&amp;action=history"/>
	<updated>2026-04-05T19:08:07Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.1</generator>
	<entry>
		<id>https://wiki.tbpindustries.com/index.php?title=Du&amp;diff=242&amp;oldid=prev</id>
		<title>Goldbolt: Created page with &quot;'''&lt;code&gt;du&lt;/code&gt;''' (abbreviated from '''''d'''isk '''u'''sage'') is a standard Unix program used to estimate file space usage—space used under a...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.tbpindustries.com/index.php?title=Du&amp;diff=242&amp;oldid=prev"/>
		<updated>2020-03-11T13:34:55Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;du&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; (abbreviated from &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;d&amp;#039;&amp;#039;&amp;#039;isk &amp;#039;&amp;#039;&amp;#039;u&amp;#039;&amp;#039;&amp;#039;sage&amp;#039;&amp;#039;) is a standard &lt;a href=&quot;/index.php?title=Unix&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Unix (page does not exist)&quot;&gt;Unix&lt;/a&gt; &lt;a href=&quot;/index.php?title=Computer_program&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Computer program (page does not exist)&quot;&gt;program&lt;/a&gt; used to estimate file space usage—space used under a...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;'''&amp;lt;code&amp;gt;du&amp;lt;/code&amp;gt;''' (abbreviated from '''''d'''isk '''u'''sage'') is a standard [[Unix]] [[computer program|program]] used to estimate file space usage—space used under a particular [[Directory (computing)|directory]] or [[computer file|files]] on a [[file system]].&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
The &amp;lt;code&amp;gt;du&amp;lt;/code&amp;gt; utility first appeared in version 1 of AT&amp;amp;T UNIX. &lt;br /&gt;
&lt;br /&gt;
== Specification ==&lt;br /&gt;
By default, the Single Unix Specification (SUS) specifies that &amp;lt;code&amp;gt;du&amp;lt;/code&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;code&amp;gt;du&amp;lt;/code&amp;gt; reports allocation space and not absolute file space, the amount of space on a file system shown by &amp;lt;code&amp;gt;du&amp;lt;/code&amp;gt; may vary from that shown by &amp;lt;code&amp;gt;[[df (Unix)|df]]&amp;lt;/code&amp;gt; if files have been deleted but their blocks not yet freed. Also the minfree setting that allocates datablocks for the filesystem and the super user processes creates a discrepancy between total blocks and the sum of used and available blocks. The minfree setting is usually set to about 5% of the total filesystem size. For more info see [http://www.gnu.org/software/coreutils/faq/coreutils-faq.html#df-Size-and-Used-and-Available-do-not-add-up core utils faq].&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&amp;lt;code&amp;gt;du&amp;lt;/code&amp;gt; takes a single argument, specifying a pathname for &amp;lt;tt&amp;gt;du&amp;lt;/tt&amp;gt; to work; if it is not specified, the current directory is used. The SUS mandates for &amp;lt;tt&amp;gt;du&amp;lt;/tt&amp;gt; the following options:&lt;br /&gt;
: &amp;lt;tt&amp;gt;-a&amp;lt;/tt&amp;gt;, In addition to the default output, include information for each non-directory entry&lt;br /&gt;
: &amp;lt;tt&amp;gt;-c&amp;lt;/tt&amp;gt;, display a grand total of the disk usage found by the other arguments&lt;br /&gt;
: &amp;lt;tt&amp;gt;-d #&amp;lt;/tt&amp;gt;, the depth at which summing should occur. -d 0 sums at the current level, -d 1 sums at the subdirectory, -d 2 at sub-subdirectories, etc.&lt;br /&gt;
: &amp;lt;tt&amp;gt;-H&amp;lt;/tt&amp;gt;, calculate disk usage for link references specified on the command line&lt;br /&gt;
: &amp;lt;tt&amp;gt;-k&amp;lt;/tt&amp;gt;, show sizes as multiples of 1024 [[byte]]s, not 512-byte&lt;br /&gt;
: &amp;lt;tt&amp;gt;-L&amp;lt;/tt&amp;gt;, calculate disk usage for link references anywhere&lt;br /&gt;
: &amp;lt;tt&amp;gt;-s&amp;lt;/tt&amp;gt;, report only the sum of the usage in the current directory, not for each file&lt;br /&gt;
: &amp;lt;tt&amp;gt;-x&amp;lt;/tt&amp;gt;, only traverse files and directories on the device on which the pathname argument is specified.&lt;br /&gt;
&lt;br /&gt;
Other Unix and Unix-like operating systems may add extra options. For example, BSD and GNU &amp;lt;code&amp;gt;du&amp;lt;/code&amp;gt; specify a &amp;lt;tt&amp;gt;-h&amp;lt;/tt&amp;gt; option, displaying disk usage in a format easier to read by the user, adding units with the appropriate [[SI prefix]] (e.g. 10 [[megabyte|MB]])..&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
Sum of directories (-s) in [[kilobyte]]s (-k):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
$ du -sk *&lt;br /&gt;
152304  directoryOne&lt;br /&gt;
1856548 directoryTwo&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Sum of directories (-s) in [[human-readable]] format (-h : Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and Petabyte):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
$ du -sh *&lt;br /&gt;
149M directoryOne&lt;br /&gt;
1.8G directoryTwo&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
disk usage of all subdirectories and files including hidden files within the current directory (sorted by filesize) :&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
 $ du -sk .[!.]* *| sort -n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
disk usage of all subdirectories and files including hidden files within the current directory (sorted by reverse filesize) :&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
 $ du -sk .[!.]* *| sort -nr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The weight (size) of each subdirectory under the current directory (-d 1) with a sum total at the end (-c) all displayed in human-readable format (-h):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
 $ du -d 1 -c -h&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
or with du from GNU:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
 $ du --max-depth=1 -c -h&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The weight (size) of subdirectories under the root directory (-d 1, trailing /) with a sum total at the end (-c), all displayed in human-readable format (-h) without traversing into other filesystems (-x). Useful when /var /tmp or other directories are on separate storage from the root directory:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
 $ du -d 1 -c -h -x /&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
or with du from GNU:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
 $ du --max-depth=1 -c -h -x /&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
=== Manual pages ===&lt;br /&gt;
* [http://www.gnu.org/software/coreutils/manual/html_node/du-invocation.html du] &amp;amp;mdash; manual page from [[GNU]] [[coreutils]]&lt;br /&gt;
* [http://www.openbsd.org/cgi-bin/man.cgi?query=du du] &amp;amp;mdash; manual page from [[OpenBSD]]&lt;br /&gt;
* [http://leaf.dragonflybsd.org/cgi/web-man?command=du&amp;amp;section=ANY du] &amp;amp;mdash; manual page from [[Dragonflybsd]]&lt;/div&gt;</summary>
		<author><name>Goldbolt</name></author>
		
	</entry>
</feed>