Disk usage

For the disk usage under a Linux environment typically you can execute the command of du -h, the h flag will provide the capacity in a easy human readable format.

Sometimes you may wish to exclude a folder as the data is irrelevant or you don’t want to count the total capacity if a particular directory.

du -h --exclude='.snapshots' /home/centos/

This will calculate the total capacity of files under the path of /home/centos but any files under /home/centos/.snapshots won’t be taken into consideration.