2014-02-10 20:27:59 +00:00
|
|
|
# du
|
|
|
|
|
2016-09-10 12:18:28 +01:00
|
|
|
> Disk usage: estimate and summarize file and folder space usage.
|
2014-02-10 20:27:59 +00:00
|
|
|
|
2016-09-10 12:18:28 +01:00
|
|
|
- List the sizes of a folder and any subfolders, in the given unit (KB/MB/GB):
|
2014-02-10 20:27:59 +00:00
|
|
|
|
2016-09-10 12:18:28 +01:00
|
|
|
`du -{{k|m|g}} {{path/to/folder}}`
|
2014-02-10 20:27:59 +00:00
|
|
|
|
2016-09-10 12:18:28 +01:00
|
|
|
- List the sizes of a folder and any subfolders, in human-readable form (i.e. auto-selecting the appropriate unit for each size):
|
2014-02-10 20:27:59 +00:00
|
|
|
|
2016-09-10 12:18:28 +01:00
|
|
|
`du -h {{path/to/folder}}`
|
2014-02-10 20:27:59 +00:00
|
|
|
|
2016-09-10 12:18:28 +01:00
|
|
|
- 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:
|
2014-02-10 20:27:59 +00:00
|
|
|
|
2016-08-03 12:30:02 +01:00
|
|
|
`du -ah {{path/to/folder}}`
|
2014-02-10 20:27:59 +00:00
|
|
|
|
2016-09-10 12:18:28 +01:00
|
|
|
- List the human-readable sizes of a folder and any subfolders, up to N levels deep:
|
|
|
|
|
|
|
|
`du -h -d {{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:
|
2014-02-10 20:27:59 +00:00
|
|
|
|
2016-09-10 12:18:28 +01:00
|
|
|
`du -ch */*.jpg`
|