How can I calculate the size of a directory?
How to know the size of a directory? Including subdirectories and files.
Does this answer your question? How do I get the size of a directory on the command line?
du -s directory_name
Or to get human readable output:
du -sh directory_name
-soption means that it won't list the size for each subdirectory, only the total size.
Actually `du`'s default unit is 512-byte blocks according to POSIX, and kilobytes on Linux (unless the environment variable `POSIXLY_CORRECT` is set) or with `du -k`.
if the directory is very big and have lots of subdirectories, it takes lots of time... almost 1 min.. is that normal? is there a way to get the size more rapidly?