Site icon Bytefreaks.net

Get the total size of a directory or file

Advertisements

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.

This post is also available in: Greek

Exit mobile version