How to check size of a directory via Terminal in MacOS

Print Friendly, PDF & Email

Sometimes we want to have a quick check the size of a specific directory in your current place from the terminal where you are working. Instead of opening Finder application – a common and unique file explorer on Mac, this need can be done by running the following command

du -sh <directory>

You can learn this command by running man du to see the other options as well as other usages. To remember this command, actually, du is short for “display disk usage statistics”.

The output of du -sh ./* command

If we don’t indicate a directory and -sh, the command will display the size of all directories recursively which are including all children directories. The size shows in bytes.

The output of du command

Hopefully, these tricks would bring a convenient way for you to check a directory’s size.

All constructive comments are welcomed. If you are willing to contribute financial support for our website, please follow the instructions below.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.