12

Possible Duplicate:
How to know the size of a directory?

If I run

ls -lh

then any given directory is just shown as 4.0K. How can I can make it consider the files the directory refers to as well?

1
  • marking a question as a duplicate without linking to the duplicate is like having sex without an orgasm...
    – aequalsb
    Feb 9, 2017 at 14:30

1 Answer 1

7

Use du -h and all directories and their subdirectories are being aggregated. (The -h makes it human readable as in useful units like MB, GB or KB)

2
  • 1
    -h does not show the total size of the directories including it's contents
    – aequalsb
    Feb 9, 2017 at 14:31
  • Really helpful to add --max-depth=1 to only show disk space on the first level of forlders
    – kimy82
    Dec 9, 2021 at 12:37

Not the answer you're looking for? Browse other questions tagged or ask your own question.