Babak K. Shandiz
Babak K. Shandiz's Blog

Babak K. Shandiz's Blog

Living in the Shell #18; du (Report Directory Size)

Living in the Shell #18; du (Report Directory Size)

Babak K. Shandiz's photo
Babak K. Shandiz
·Dec 17, 2021·

1 min read

du 💽

Reports disk usage.

See summarized directory size -s

du -s ~/Downloads
11732700        /home/babak/Downloads

Note that the result is in kilobytes.

Human-readable size values -h

du -sh ~/Downloads
12G   /home/babak/Downloads

Exclude files by pattern --exclude

du -sh --exclude '*.iso' ~/Downloads
7.1G   /home/babak/Downloads

See exhaustive sub-directory sizes

du ~/Documents

Limit recursion depth -d

du -h -d 1 ~/Documents

Include files in exhaustive size report -a

du -h -a ~/Documents
 
Share this