September 12, 2024

Show the total size of a folder recursively with du

$ du -sh folder_1/
13 GB folder_1

Recursively’ means that du will compute the size of folder_1 including all other folders that are nested under it, for example folder_2 and folder_3.

folder_1/
├── folder_2
└── folder_3

The flag -s tells du to hide the details and only show the total, in our case 13 GB folder_1.

For more info, see man du.

See also https://yctct.com/show-size to show size of files from the command line interface.


personal computing command-line interface (cli) gnu linux trisquel shell literacy office applications wiki du

No affiliate links, no analytics, no tracking, no cookies. This work © 2016-2024 by yctct is licensed under CC BY-ND 4.0 .   about me   contact me   all entries & tags   FAQ   GPG public key

GPG fingerprint: 2E0F FB60 7FEF 11D0 FB45 4DDC E979 E52A 7036 7A88