How do I list all the files in a directory and their recursive file sizes?
---edit
I want to see the sizes 'rolled up' to the parent directories in the directory listed. I don't want to see the child directories or their contents or sizes.
|
|
I guess the easiest way is by typing If 'recursively' means listing all the subsequent folders, e.g.: /foo/ Then you should also add parameter More information for Update: The following command as Lekensteyn proposed will probably do the job:
|
||||
|
|
|
Also check out Example:
More options can be found in the man page. |
|||||
|
|
|
Since you don't specifically mention you need a terminal-based solution, I think baobab a.k.a. Disk Usage Analyzer is missing from the list. It is installed in Ubuntu by default and does exactly what you want in a nice graphical UI with the ability to drill down the directory hierarchy. Apart from displaying a list of directories with their sizes, it is also showing a rings or treemap chart of filesystem usage, which is extremely useful for visualising the directories which take up the most space.
|
|||
|
|
|
To get the total size of a directory and all children du -hs directory/* |
|||||
|
It is interactive too so if you want to check on a sub folder just UP, DOWN, and Enter to it. |
|||
|
|
|
A terminal solution is the
(shorthand:
|
|||
|
|