Update cheatsheets

This commit is contained in:
ivuorinen
2025-03-13 00:18:34 +00:00
parent ffbd8c31db
commit 904f7fe0c1
46 changed files with 228 additions and 157 deletions

14
tldr/du
View File

@@ -14,24 +14,24 @@ source: https://github.com/tldr-pages/tldr.git
- List the sizes of a directory and any subdirectories, in human-readable form (i.e. auto-selecting the appropriate unit for each size):
`du -h {{path/to/directory}}`
`du {{[-h|--human-readable]}} {{path/to/directory}}`
- Show the size of a single directory, in human-readable units:
`du -sh {{path/to/directory}}`
`du {{[-sh|--summarize --human-readable]}} {{path/to/directory}}`
- List the human-readable sizes of a directory and of all the files and directories within it:
`du -ah {{path/to/directory}}`
`du {{[-ah|--all --human-readable]}} {{path/to/directory}}`
- List the human-readable sizes of a directory and any subdirectories, up to N levels deep:
`du -h --max-depth=N {{path/to/directory}}`
`du {{[-h|--human-readable]}} {{[-d|--max-depth]}} N {{path/to/directory}}`
- List the human-readable size of all `.jpg` files in current directory, and show a cumulative total at the end:
`du -ch {{./*.jpg}}`
`du {{[-ch|--total --human-readable]}} {{./*.jpg}}`
- List all files and directories (including hidden ones) above a certain [t]hreshold size (useful for investigating what is actually taking up the space):
- List all files and directories (including hidden ones) above a certain threshold size (useful for investigating what is actually taking up the space):
`du --all --human-readable --threshold {{1G|1024M|1048576K}} .[^.]* *`
`du {{[-ah|--all --human-readable]}} {{[-t|--threshold]}} {{1G|1024M|1048576K}} .[^.]* *`