tldr/pages/linux/du.md
Waldir Pimenta 62d4d4816f du: rework page, add glob matching example (fixes #1032) (#1034)
* fixup: remove excess whitespace

* du: various tweaks

- improve main description (include what "du" stands for)
- simplify globbing example
- unify nomenclature of folder/directory
- minor tweaks to existing descriptions

* du: a bunch of further rewordings

these changes aim to improve both clarity but also the sequence of commands to make it easier to build a mental model of how the tool works.

* osx/du: sync w/ changes in the linux folder

* linux/du: sync w/ changes in the osx folder

* remove slighly redundant «recursively» to make description simpler
2016-09-10 12:18:28 +01:00

28 lines
828 B
Markdown

# du
> Disk usage: estimate and summarize file and folder space usage.
- List the sizes of a folder and any subfolders, in the given unit (B/KB/MB):
`du -{{b|k|m}} {{path/to/folder}}`
- List the sizes of a folder and any subfolders, in human-readable form (i.e. auto-selecting the appropriate unit for each size):
`du -h {{path/to/folder}}`
- Show the size of a single folder, in human readable units:
`du -sh {{path/to/folder}}`
- List the human-readable sizes of a folder and of all the files and folders within it:
`du -ah {{path/to/folder}}`
- List the human-readable sizes of a folder and any subfolders, up to N levels deep:
`du -h --max-depth=N {{path/to/folder}}`
- List the human-readable size of all .jpg files in subfolders of the current folder, and show a cumulative total at the end:
`du -ch */*.jpg`