Below are the ways to find the size of a directory and a file using Terminal app on a Mac.
Steps to Know Directory Size on Mac
- Open Terminal app using Spotlight Search.
Move to the directory that you want to know the size of.
Example:du -shYou will see the size of the directory displayed in KB/MB/GB.

Now run the command du with the flags "-sh"
Example:cd ~/Desktop
Know the size of a file
- Open Terminal App.
- Now move to the directory where the file is located.
Run the command ls with flags -lh followed by the filename.
Example:% ls -lh get.py -rwx------@ 1 dev staff 959B Aug 1 14:26 get.py
Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!