Andy Jarrett // Code. Develop. Manage.

List a folder size from Terminal

There are a few apps out there to find the size of a folder but don't forget a lot of these are simply GUIs for terminal scripts. With that in mind I went looking on the best way to get the size of a folder from a script in Terminal, and it turns out DU (Disk Usage) is what you need. Below outputs the most basic information you need for a folder size:

du -h -c -s ~/Downloads/-h human readable
-c print the grand total
-s summarise

Of course there is a lot more to it, just type man DU at your terminal to find out more.


I’m here, learning and working away. If you liked this content and want to keep me going, consider buying me a coffee.
Your support keeps this site running and the coffee brewing! ☕️