Get the total size of a directory or file


du -sh someName

*INFO: someName can be replaced by any folder or file name or even a regular expression (for example to get the size of all txt files you need to invoke du -sh *.txt)
By using the parameter -s (which stands for summarize) you will get back only the total size in bytes.
By using the parameter -h (which stands for human readable format), for any size output you will get it back in Kilobytes, Megabytes etc.

Leave a Reply