bash check directory size code example
Example 1: how to check folder size in linux
# show all folder size in the current directory
du -h --max-depth=1
Example 2: shell get size of directory
du -h your_directory
# gives you the size of your target directory.
du -hcs your_directory
# If you want a brief output.
Example 3: bash folder size
du -hs /Path/to/your/folder