Home > News Tips

Step-by-Step Guide: How to Check Folder Size Using Terminal on Mac

Updated on Thursday, April 10, 2025

iBoysoft author Yvonne Feng

Written by

Yvonne Feng
Professional tech editor

Approved by

Jessica Shee

English Français Deutsch やまと Español Português Türkçe

Summary: This article from iBoysoft tells you how to check folder size using Terminal. At the same time, you will learn about other ways to check folder size on Mac.

summary-mac-how-to-check-folder-size-using-terminal

Folder sizes aren't displayed by default on Mac. When you view folders in column or list view in Finder, you'll often just see two dashes (--) instead of the actual size. You'll need to tweak some settings to see folder sizes in Finder.

However, if you want a faster and more efficient way, Terminal is a great option. With just one command, you can list and sort the sizes of all folders at once. In this guide, we'll show you how to check folder size using Terminal, and also introduce other useful methods.

How to check folder size in Terminal

In Terminal, we can use the du (disk usage) command to check the size of folders. This method is faster and more efficient than Finder, and you can use it to check the space usage of multiple folders.

  1. Check the total size of a folder.du -sh /path/to/folder
  2. Check the size of all items in the current directory.du -sh * | sort -h
  3. Recursively list the sizes of all subfolders. This command will display the size of every subfolder within the directory, helping you identify large files or areas that are taking up space.du -h /path/to/folder
  4. Use the following command to include hidden folders (such as .git, .config, etc.) in the size calculation.du -sh .[^.]* *

 Note: Remember to replace the /path/to/folder with the actual path of the folder. If you encounter a permission error, you can prepend the command with sudo (e.g., sudo du -sh /path/to/folder).

Share this part to guide more people to know how to check folder size using Terminal!

 

Is there any other way to check folder size on Mac

Sure, you can check folder size on Mac through Finder, but you need to make some adjustments first. Here's how to set it up:

  1. Click the Finder icon in the Dock to open Finder.
  2. Navigate to the folder or directory where you want to check the size. Switch to List View by pressing Command + 2 or selecting View > as List from the top menu. 
     switch-to-list-view
  3. In the top Finder menu, click View, then select Show View Options (or press Command + J). 
     select-show-view-options
  4. In the View Options panel, check the box for Calculate all sizes
     calculate-all-sizes
  5. The Finder will start calculating the size of each folder, and after a while, you'll be able to see the size of each folder.

 Note: Since Finder needs to calculate the size of each item, this process might slow down Finder, especially when dealing with large folders or directories containing many files.

Of course, if you only need to check the size of a single folder, you can simply click on the folder, then select Get Info from the menu, or press Command + I. In the pop-up Get Info window, you will see the folder's detailed information, including its size. 
 finder-get-info-file-size

How to check storage on Mac via Terminal

If you want to check storage on your Mac, using Terminal is the quickest and most convenient way. Open your Terminal, enter the following command, and press Enter to get the disk space usage of mounted file systems:

df -h

The df -h command displays disk usage in a human-readable format (e.g., GB, MB). The key columns to look at are:

  • Filesystem: Shows the disk or partition.
  • Size: Total space of the disk or partition.
  • Used: Space that is used.
  • Avail: Available free space.
  • Capacity: Percentage of disk space that is used.

Share this article with others if you know how to check folder size and check storage using Terminal.