directory – How to Calculate the Size of a Directory

directory

How to know the size of a directory? Including subdirectories and files.

Best Answer

du -s directory_name

Or to get human readable output:

du -sh directory_name

The -s option means that it won't list the size for each subdirectory, only the total size.

Related Question