you (Unix)
The Unix program du (from English “disk usage”), which belongs to the coreutils , is used to display the file sizes of all elements in the current directory.
history
The first version of du appeared in version 1 of the AT&T UNIX .
Important arguments
Lang arguments typically only appear in the GNU version.
-
-a
shows all files. -
--apparent-size
shows visible size (very small text files on the file system can be larger than the actual amount of data due to the minimum block size, and e.g. on compressed file systems the visible size can be larger than the actual amount of memory used) -
-b
shows the file sizes in bytes instead of kilobytes . (GNU specific) -
-c
shows the total size at the end of the output. -
-h
shows the sizes "human readable", ie in megabytes , gigabytes ... instead of sometimes very high kilobytes. -
-s
only shows the sum of all file sizes, not the individual elements. -
--si
uses SI sizes (one kilobyte = 1000 bytes), i.e. not KiB (= 1024 bytes), MiB ... -
--time
shows the time of the last change.
Examples
Show all files, also in subdirectories, in human-readable size:
$ du -ah
344K ./directory/Formatierungen.pdf
352K ./directory
1,1M ./Spickzettel.pdf
32K ./WeihnachtsWiki.png
8,0K ./Wikipediabausteine.txt
1,5M .
Show all files, also in subdirectories, in kilobytes and the time of the last change:
$ du -a --time
344 2009-11-09 21:47 ./directory/Formatierungen.pdf
352 2011-03-09 17:59 ./directory
1040 2009-10-10 11:25 ./Spickzettel.pdf
32 2009-12-24 18:56 ./WeihnachtsWiki.png
8 2009-11-03 18:34 ./Wikipediabausteine.txt
1440 2011-03-09 17:59 .
Show all files, also in subdirectories, in SI units (compare first example) and in the visible size:
$ du -ah --apparent-size --si
349k ./directory/Formatierungen.pdf
357k ./directory
1,1M ./Spickzettel.pdf
27k ./WeihnachtsWiki.png
772 ./Wikipediabausteine.txt
1,5M .
See also
Web links
-
Manual page (manpage) too
du(1)