Skip to content

Latest commit

 

History

History
46 lines (39 loc) · 986 Bytes

du.md

File metadata and controls

46 lines (39 loc) · 986 Bytes

Disk usage

basic

du -ah -d1
#   ││  └─ depth
#   │└─ human readable
#   └─ all files, not only dirs

Warning

du -sh * # .files/folders would be missed!
#   └─ summarize (same as -d0)

filtered and sorted

du -ah -d1 -t100m | sort -hr
#           │             └┴─ human, reverse
#           └─ min threshold

Note

with old versions of du/sort, use:

du -a --max-depth 1 | sort -nr

filtered, sorted and pretty output

du -ah0 -d1 -t100m | sort -hrz | perl -0lane 's:^\./:: for @F; print shift @F, " ", `ls -d --color "@F"`'

Note

  • du: remove/increase -d1 in order to descend into directories
  • du: skip files/folders with --exclude

with old versions of du/sort, use:

du -a --max-depth 1 | sort -nr | head | perl -ane 's:^\./:: for @F; print shift @F, " ", `ls -d --color "@F"`'

Total

du -sh /folder