Du (Unix)

du
Original author(s)Dennis Ritchie
(AT&T Bell Laboratories)
Developer(s)Various open-source and commercial developers
Initial release3 November 1971; 53 years ago (1971-11-03)
Written inPlan 9, FreeDOS: C
Operating systemUnix, Unix-like, Plan 9, Inferno, FreeDOS
PlatformCross-platform
TypeCommand
Licensecoreutils: GPLv3+
Plan 9: MIT License
FreeDOS: GPLv2

du (abbreviated from disk usage) is a standard Unix program used to estimate file space usage—space used under a particular directory or files on a file system. A Windows commandline version of this program is part of Sysinternals suite by Mark Russinovich.

History

The du utility first appeared in version 1 of AT&T UNIX. The version of du bundled in GNU coreutils was written by Torbjorn Granlund, David MacKenzie, Paul Eggert, and Jim Meyering.[1] The command is also available for FreeDOS.[2]

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. 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 core utils faq.

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, In addition to the default output, include information for each non-directory entry
  • -c, display a grand total of the disk usage found by the other arguments
  • -d #, 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.
  • -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 directory therein contained
  • -x, only traverse files and directories on the device on which the pathname argument is specified.

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 (e.g. 10 MB).

Examples

Sum of directories (-s) in kilobytes (-k):

$ du -sk *
152304  directoryOne
1856548 directoryTwo

Sum of directories (-s) in human-readable format (-h : Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and Petabyte):

$ du -sh *
149M directoryOne
1.8G directoryTwo

disk usage of all subdirectories and files including hidden files within the current directory (sorted by filesize) :

$ du -sk .[!.]* *| sort -n

disk usage of all subdirectories and files including hidden files within the current directory (sorted by reverse filesize) :

$ du -sk .[!.]* *| sort -nr

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):

$ du -d 1 -c -h

or with du from GNU:

$ du --max-depth=1 -c -h

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:

$ du -d 1 -c -h -x /

or with du from GNU:

$ du --max-depth=1 -c -h -x /

See also

References

  1. ^ du(1) – Linux User Commands Manual
  2. ^ "ibiblio.org FreeDOS 1.2 Updates Package -- du (Unix-like)". www.ibiblio.org.

Read other articles:

أغوسان ديل نورت (بالإنجليزية: Province of Agusan del Norte)‏  أغوسان ديل نورت  خريطة الموقع تاريخ التأسيس 17 يونيو 1967  تقسيم إداري البلد الفلبين  [1] العاصمة كابادباران التقسيم الأعلى كاراجا  خصائص جغرافية إحداثيات 9°10′00″N 125°30′00″E / 9.1666666666667°N 125.5°E / 9.166666666666...

 

Artikel ini perlu dikembangkan agar dapat memenuhi kriteria sebagai entri Wikipedia.Bantulah untuk mengembangkan artikel ini. Jika tidak dikembangkan, artikel ini akan dihapus. Menara HerculesLetakA Coruña, Galisia, SpanyolKetinggian57 meter (187 ft)Pengunjung149.440[1] (tahun 2009)Badan pengelolaKementerian Kebudayaan Situs Warisan Dunia UNESCONama resmi: Menara HerculesJenisKulturalKriteriaiiiDitetapkan2009 (sesi ke-33)1312 UNESCO.orgNegara SpanyolWilayahEropa dan Am...

 

Eiji Wentzウエンツ 瑛士Nama lainWentz(-kun), Ei-chan,Lahir8 Oktober 1985 (umur 38)Asal Tokyo, JepangGenrepop, rockPekerjaanpenyanyi pencipta laguTahun aktif1989–sekarangSitus webSitus resmi Eiji Wentz (ウェンツ瑛士code: ja is deprecated , Wentsu Eiji, lahir 8 Oktober 1985) adalah seorang penyanyi, penghibur dan pemeran Jepang asal Mitaka, Tokyo, Jepang. Anggota duo WaT bersama Teppei Koike. Wentz berada di bawah kantor manajemen artis Burning Productions. Karier Pertunjukan...

Zaki al-Arsuziزكي الأرسوزي Zaki al-Arsuzi, antes de 1939.Información personalNombre en árabe زكي الأرسوزي Nacimiento junio de 1899LatakiaFallecimiento 2 de julio de 1968DamascoSepultura The cemetery of Dahdah Nacionalidad SiriaReligión Alauismo EducaciónEducado en Universidad de París Información profesionalOcupación Político, escritor, filósofo y sociólogo Movimiento Baazismo Partido político Partido del Renacimiento Árabe Socialista [editar datos en Wi...

 

Novios peruanos en su ceremonia religiosa de boda (2012) Bailes populares en los festejos de una boda en la Plaza de Armas de Chucuito, Puno El matrimonio en el Perú es una institución social, tanto civil como religiosa, que ha tenido diferentes concepciones y características a lo largo de la historia del país, el cual ha sido considerado como socialconservador y predominantemente católico, conservándose el matrimonio civil hasta la actualidad como la unión entre un hombre y una mujer ...

 

Sekolah KomunikasiTNI Angkatan LautBerkas:Logo Sekolah Komunikasi TNI AL.pngNegaraIndonesiaCabang TNI Angkatan LautTipe unitKomando PendidikanBagian dariBerkas:Kodiklatal.jpg KodiklatalJulukanSekomalMotoHatu Caraka BhuanaSitus webwww.sekomtnial.blogspot.co.id Sekolah Komunikasi TNI Angkatan Laut (Sekomal TNI AL) adalah Satuan kerja dibawah Pusat Pendidikan Pelaut Komando Pendidikan Operasi Laut yang merupakan ujung tombak Kodiklatal dalam mendidik dan menyiapkam SDM khususnya Prajurit Matra L...

Campaign for US presidency Jeb 2016, Inc.Campaign2016 U.S. presidential electionCandidateJeb BushAffiliationRepublican PartyAnnouncedJune 15, 2015SuspendedFebruary 20, 2016HeadquartersP.O. Box 440641Miami, FloridaKey peopleDanny L. Diaz (campaign manager)David Kochel (chief strategist)Jon Downs (media strategist)Tim Miller (communications director)Janan Grissom (chief operating officer)ReceiptsUS$35,415,732[1]Slogan ChantJeb!Websitewww.Jeb2016.com This article is part of a series...

 

  لمعانٍ أخرى، طالع ضريح بيبي (توضيح).ضريح بيبي دتشترانمعلومات عامةنوع المبنى ضريح[1][2] — ضريح مقدس[2] — ممتلكات ثقافية[3][1][2] المكان شيراز[3][1][2] المنطقة الإدارية مقاطعة شيراز[3][1] البلد  إيران[3][1] المدينة شيرازأبرز

 

Terremoto de Ludian de 2014 6,1 en potencia de Magnitud de Momento (MW) ParámetrosFecha y hora 3 de agosto de 2014, 16:30 hora localProfundidad 10.0 kmCoordenadas del epicentro 27°06′N 103°18′E / 27.1, 103.3ConsecuenciasZonas afectadas Provincia de Yunnan,  ChinaMercalli VIIRéplicas 445Víctimas 729 muertos[1]​ más de 3.100 heridos[1]​ [1]​[2]​ [3]​ [4]​ [5]​ [6]​[editar datos en Wikidata] El terremoto de ...

James Monroe, Presiden Amerika Serikat. Doktrin Monroe adalah kebijakan luar negeri Amerika Serikat yang diterapkan pada 2 Desember 1823. Dalam kebijakan ini, upaya negara-negara Eropa untuk menjajah atau melakukan campur tangan terhadap negara-negara di benua Amerika akan dipandang sebagai agresi, sehingga AS akan turun tangan.[1] Akan tetapi, Amerika Serikat tidak akan mengganggu jajahan Eropa yang sudah ada. Doktrin ini diterapkan setelah sebagian besar jajahan Spanyol dan Portugal...

 

This article includes a list of general references, but it lacks sufficient corresponding inline citations. Please help to improve this article by introducing more precise citations. (May 2017) (Learn how and when to remove this template message) Battle of Delaware BayPart of the American Revolutionary WarThe Hyder Ally engaging HMS General MonkDateApril 8, 1782Locationoff Cape May, New Jersey, Cape May, Delaware Bay, Atlantic OceanResult U.S. victoryBelligerents  United States  Gre...

 

Día de Castilla y León Ofrenda en Villalar en 2006.LocalizaciónPaís  EspañaLocalidad Castilla y LeónDatos generalesTipo día festivoFecha 23 de abrilOrigen Conmemoración de la batalla de Villalar[editar datos en Wikidata] Monolito en Villalar de los Comuneros Bandera de Castilla y León Escudo de Castilla y León El Día de Castilla y León es la fiesta oficial de dicha comunidad autónoma española. El centro de la celebración es la localidad vallisoletana de Villalar ...

German pop music duo Modern TalkingModern Talking during their final concert in 2003Background informationOriginWest Berlin, West GermanyGenresEuropop[1]synth-pop[2]dance-pop[3]Euro disco[4]Years active1983–19871998–2003LabelsHansaAriolaRCASony BMGPast membersDieter BohlenThomas Anders Modern Talking was a German pop duo consisting of arranger, songwriter and producer Dieter Bohlen[5] and singer Thomas Anders. They have been referred to as Germany's...

 

Moroccan footballer (born 1998) Walid Cheddira Cheddira with Morocco in 2023Personal informationFull name Walid Cheddira[1]Date of birth (1998-01-22) 22 January 1998 (age 25)Place of birth Loreto, ItalyHeight 1.87 m (6 ft 2 in)Position(s) ForwardTeam informationCurrent team Frosinone(on loan from Napoli)Number 70Senior career*Years Team Apps (Gls)2015–2017 Loreto 49 (9)2017–2019 Sangiustese 72 (20)2019–2021 Parma 0 (0)2019–2020 → Arezzo (loan) 13 (0)2020 ...

 

American judge (born 1977) Matthew J. MaddoxJudge of the United States District Court for the District of MarylandIncumbentAssumed office November 3, 2023Appointed byJoe BidenPreceded byPaul W. GrimmMagistrate Judge of the United States District Court for the District of MarylandIn officeFebruary 22, 2022 – November 3, 2023Preceded byThomas M. DiGirolamoSucceeded byErin Alsan Personal detailsBornMatthew James Maddox1977 (age 45–46)Rossville, Maryland, U.S.EducationMo...

Season of television series Doctor WhoSeason 23Cover art of the Blu-ray release for the complete seasonStarringColin BakerNicola BryantBonnie LangfordLynda BellinghamMichael JaystonCountry of originUnited KingdomNo. of stories1No. of episodes14ReleaseOriginal networkBBC1Original release6 September (1986-09-06) –6 December 1986 (1986-12-06)Season chronology← PreviousSeason 22 Next →Season 24 List of episodes The twenty-third season of British science fiction tele...

 

American politician and civil rights leader (1940–2020) This article is about the U.S. representative from Georgia. For the British department stores, see John Lewis & Partners. For other people of the same name, see John Lewis (disambiguation). John LewisLewis in 2006House Democratic Senior Chief Deputy WhipIn officeJanuary 3, 2003 – July 17, 2020LeaderDick GephardtNancy PelosiPreceded byPosition establishedSucceeded byG. K. ButterfieldMember of the U.S. House of ...

 

British artist and designer (1857–1896) Beatrice Whistlerc. 1887Born(1857-05-12)12 May 1857Chelsea, London, EnglandDied10 May 1896(1896-05-10) (aged 38)Hampstead Heath, London, EnglandOther namesBeatrixTrixieOccupation(s)Artist and artist’s modelSpouse(s)Edward William Godwin (1876–1885)James Abbott McNeill Whistler (1888–1896)Parent(s)John Birnie Philip and Frances Black Beatrice Whistler (also known as Beatrix or Trixie; 12 May 1857 – 10 May 1896) was born in Chelsea, Lo...

Town and municipalityBratunac БратунацTown and municipalityBratunac Coat of armsLocation of Bratunac within Bosnia and HerzegovinaCoordinates: 44°11′02″N 19°19′51″E / 44.18389°N 19.33083°E / 44.18389; 19.33083Country Bosnia and HerzegovinaEntity Republika SrpskaGeographical regionPodrinjeGovernment • Municipal mayorLazar Prodanović (SNSD) • Municipality293.49 km2 (113.32 sq mi)Population (2...

 

Luis Mariano RiveraBornAugust 19, 1906Canchunchú Valley, Sucre State, VenezuelaDiedMarch 15, 2002 (2002-03-16) (aged 95) Luis Mariano Rivera (1906-2002) was a Venezuelan singer, composer, poet, and dramatist. He was born on August 19, 1906, and was a self-taught musician.[1] He wrote hundreds of songs that have been performed by musicians including Morella Muñoz, Jesús Sevillano, Gualberto Ibarreto, Juan Carlos Salazar, Cecilia Todd, Lilia Vera, Simón Díaz, Serenata Gua...

 

Strategi Solo vs Squad di Free Fire: Cara Menang Mudah!