Bash: Get folder size

du – estimate file space usage
du -options /path/to/file/or/folder

  • -a all files, write out all files with there size.
  • -h human readable e.g. 100k or 2M or 3G, etc
  • -s summarize, just the total.

e.g.

du -sh

would output the size of the current directory.


About this entry