> ## Content Index
> Fetch the complete content index at: https://macfixly.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# How to Check Disk Usage with du in Mac Terminal: A Step-by-Step Guide
- URL: https://macfixly.com/check-disk-usage-du-mac-terminal/
- Published: 2026-10-15T19:47:10.000Z
- Updated: 2026-10-15T19:47:10.000Z
- Description: Learn how to check disk usage with du in Mac Terminal to identify large files and folders and manage your Mac's storage effectively.
- Author: Macuser
- Tags: Mac Terminal, Disk Usage, Command Line, Storage Management

Your Mac's storage is filling up, and you need to identify which files or folders take the most space. Simply navigating Finder or the Storage tab in About This Mac often doesn't provide the detailed insights you need.

This guide explains how to check disk usage with du in Mac Terminal, a powerful command-line tool that helps you analyze storage by showing the size of directories and files. You'll learn how to run basic commands, interpret the output, and use options that make the results easier to understand. The article also compares du with other disk usage tools and offers troubleshooting tips to handle common errors.

## Key takeaways

- The basic du command shows disk usage for files and directories in bytes.
- Using the -h option provides human-readable sizes like MB or GB for easier interpretation.
- Summarize directory totals with the -s option to focus on overall space usage.
- Combine options to check specific directories or files for targeted analysis.
- du is lightweight but less visual than some GUI tools; choose based on your needs.

## Before you start with du: what you need

To begin using **du** on your Mac, first ensure you have access to the Terminal application. You can find this in *Applications > Utilities > Terminal* or by searching for "Terminal" using Spotlight.

The **du** command comes pre-installed on macOS, so no additional setup is necessary. To verify its availability, open Terminal and type `du --version` or `du`, then press Enter. You should see usage information or version details confirming it is present.

Basic familiarity with Terminal navigation commands such as `cd` (change directory) and `ls` (list directory contents) is essential to specify paths and interpret results effectively.

Note that some directories may require administrator privileges to access their disk usage. In such cases, prefacing commands with `sudo` will prompt for your password and grant elevated permissions.

1. Open Terminal from *Applications > Utilities* or Spotlight.
2. Type `du --version` or `du` and press Enter; you should see usage instructions or version output indicating `du` is installed.
3. Use `cd` to navigate to a directory and `ls` to list contents as a test of your navigation skills.
4. If you access protected directories, try running `sudo du` and enter your password when prompted to confirm administrator privileges.

## Running the basic du command to check disk usage

The simplest way to use `du` is to run it on a directory or file to see how much disk space it occupies. By default, `du` reports sizes in disk blocks, which are typically 512 bytes each on Mac systems. This means the numbers shown represent the number of 512-byte blocks used.

To check disk usage for your home directory, open Terminal and enter the following command:

1. Type `du ~` and press Enter.
2. You will see a list of subdirectories and their sizes in blocks, ending with the total size of your home directory.

For example, an output line showing `2048 /Users/yourname/Documents` means the Documents folder uses approximately 1 MB of disk space (2048 blocks × 512 bytes = 1,048,576 bytes).

This basic output helps you quickly identify how space is distributed, though interpreting block sizes can be less intuitive without conversion to human-readable units.

## Using options to get human-readable output and summaries

The default **du** output can be difficult to interpret because sizes are shown in 512-byte blocks. To make the information clearer, use the `-h` option, which converts sizes into human-readable units like KB, MB, or GB.

![Using options to get human-readable output and summaries – how to check disk usage with du in Mac Terminal](https://macfixly.com/content/images/2026/10/check-disk-usage-du-mac-terminal-2.webp)

1. Run `du -h /path/to/directory`. You will see disk usage with sizes formatted for easy reading, such as *1.2M* for megabytes or *500K* for kilobytes.
2. To get a summary total rather than detailed listings, add the `-s` flag: `du -s /path/to/directory`. This shows the total size in 512-byte blocks.
3. Combine both options for a concise, human-readable summary: `du -sh /path/to/directory`. The output might display something like *45M /path/to/directory*, indicating the entire directory uses 45 megabytes of disk space.

For example, without options, `du /Users/username/Documents` might return *102400 /Users/username/Documents*, which means 102,400 blocks or about 50 MB. Using `du -sh /Users/username/Documents` simplifies this to *50M /Users/username/Documents*.

Using these flags helps you quickly gauge disk usage and decide which areas consume the most space without manual calculations.

## Checking disk usage for specific directories and files

You can direct the **du** command at particular directories or files by specifying their paths, allowing targeted analysis of disk usage. This approach helps you focus on areas where storage may be heavily consumed.

1. Open Terminal and enter `du -sh /Applications`. This displays the total size of the Applications folder in a human-readable format, helping you understand its storage footprint.
2. Run `du -sh ~/Documents` to check the size of your Documents folder. Comparing this to /Applications highlights which location uses more space.
3. Use wildcards for more granular checks, for example, `du -sh ~/Documents/*.pdf` lists the size of each PDF file in your Documents, showing individual file usage.
4. For relative paths, such as files inside your current directory, run `du -sh./foldername`. This is useful when navigating project folders.
5. Interpret the output by comparing sizes: larger values indicate heavier disk consumption. Use this to prioritize directories or files to clean up.

By targeting specific paths, you get precise insights into your disk usage, enabling informed decisions about storage management.

## Advanced du options for detailed analysis

To gain deeper insights into disk usage, you can use advanced `du` options that refine how data is displayed and analyzed. The `-d` or `--max-depth` flag controls how many directory levels `du` traverses, allowing you to limit output to a specific depth and focus on immediate subdirectories.

Combining `du` with the `sort` command helps identify the largest directories quickly by sorting results by size in descending order.

1. Open Terminal and navigate to the directory you want to analyze.
2. Run `du -h -d 1 | sort -hr`. This command shows human-readable sizes for all first-level subdirectories and sorts them from largest to smallest.
3. Review the output, where the largest directories appear at the top, making it easier to spot which folders consume the most space.

This method lets you efficiently pinpoint storage-heavy subdirectories without sifting through excessive detail, balancing overview and specificity effectively.

## Comparing du with other disk usage tools on Mac

macOS offers built-in graphical tools like Disk Utility and third-party apps such as DaisyDisk or GrandPerspective to visualize disk usage. These tools provide a user-friendly interface with charts and interactive elements, allowing quick identification of [large files](https://macfixly.com/find-large-files-mac-terminal/) and folders.

**du** stands out for its precision, speed, and scriptability. You can integrate it into automated workflows or scripts to generate customized reports. Its output is exact and can be tailored with numerous options, making it ideal for users comfortable in Terminal who want detailed control.

However, *du* lacks a graphical interface and requires command-line knowledge, which may be a barrier for some users. GUI tools excel in visual exploration but may not offer the same level of customization or scripting capability.

| Feature        | du                          | Disk Utility / GUI Apps            |
| -------------- | --------------------------- | ---------------------------------- |
| Interface      | Command-line                | Graphical                          |
| Customization  | High (via options, scripts) | Limited to app features            |
| Speed          | Fast for targeted queries   | Usually slower with large datasets |
| Visualization  | Text output                 | Interactive charts, treemaps       |
| Learning curve | Requires Terminal skills    | Easy for most users                |

Use **du** when you need precise, scriptable, and quick access to disk usage data, especially for repetitive or automated tasks. Choose GUI-based tools when you want an intuitive overview or visual analysis without command-line interaction.

## Troubleshooting common du issues and errors

When using **du**, you may encounter *permission denied* errors like `du:./folder: Permission denied`. To resolve this, prepend `sudo` to your command, for example, `sudo du -sh /path/to/folder`. Use `sudo` cautiously, as it grants elevated privileges.

![Troubleshooting common du issues and errors – how to check disk usage with du in Mac Terminal](https://macfixly.com/content/images/2026/10/check-disk-usage-du-mac-terminal-3.webp)

Symbolic links can cause double counting because `du` follows links by default. Avoid this by adding the `--no-dereference` option, preventing counting linked files multiple times.

Inconsistent totals may arise from sparse files or APFS snapshots. Sparse files reserve less physical space than their reported size, while snapshots may cause `du` to count data multiple times, making usage seem larger than actual.

If `du` output appears unexpectedly large or small, verify whether snapshots are present with `tmutil listlocalsnapshots /` and consider excluding them or mounting points that could skew results.

1. Run `du` and note any *permission denied* errors.  
Success: Errors disappear when rerunning with `sudo`.
2. Check for symbolic links with `ls -l`.  
Success: Use `du --no-dereference` to avoid double counting.
3. Use `tmutil listlocalsnapshots /` to list snapshots.  
Success: Identify snapshots that may inflate usage totals.
4. Exclude snapshots or adjust your analysis accordingly.  
Success: `du` output aligns more closely with expected disk usage.

## More on this topic

- [How to Search Text with Grep in Mac Terminal: A Step-by-Step Guide](https://macfixly.com/search-text-grep-mac-terminal/)
- [How to Take Ownership with chown in Mac Terminal: A Step-by-Step Guide](https://macfixly.com/take-ownership-chown-mac-terminal/)
- [How to Backup with Rsync in Mac Terminal: A Clear Step-by-Step Guide](https://macfixly.com/backup-rsync-mac-terminal/)
- [How to Use sudo Safely in Mac Terminal: A Step-by-Step Guide](https://macfixly.com/use-sudo-safely-mac-terminal/)

## Frequently asked questions

### What does the du command measure exactly on a Mac?

The du command measures the disk space used by files and directories, reporting the amount of disk blocks they occupy. It reflects actual storage usage including file system overhead, but does not count free space or metadata unrelated to file content. This makes it useful for understanding how much space specific items consume on your disk.

### How can I exclude certain directories from du output?

You can exclude directories by combining du with the **\--exclude** option followed by a pattern matching the directories to skip, for example, `du -sh --exclude=foldername *`. Alternatively, use shell features like `find` to selectively run du on desired paths while omitting others. This helps focus the output on relevant areas without clutter.

### Why does disk usage reported by du differ from Finder’s Get Info?

du reports disk usage based on actual allocated blocks, while Finder’s Get Info includes additional factors like file system metadata, extended attributes, and sometimes cached or hidden files. Finder may also round sizes differently and include package contents differently than du. These differences cause variations in reported sizes between the two methods.

### Can du show disk usage for external drives connected to my Mac?

Yes, du can analyze external drives by specifying the mount point or path to the external volume. For example, running `du -sh /Volumes/ExternalDriveName` shows disk usage for that drive. Ensure you have appropriate permissions to access the external drive’s directories to avoid errors.

## Limits of this guide and when to consider other tools

This article does not cover other disk usage commands like `df` or third-party software in depth. If you require a graphical interface for easier navigation or need real-time monitoring of disk usage, you might prefer tools such as DaisyDisk, GrandPerspective, or the built-in Storage Management utility accessible via **Apple menu > About This Mac > Storage > Manage**.

While `du` provides detailed insights through the Terminal, it may not be ideal for users uncomfortable with command-line operations or those seeking automated cleanup options.

For the most effective next step, use the `du -h -d 1` command on your home directory. This displays a human-readable summary of disk usage for each folder one level deep, helping you quickly identify large directories worth reviewing. Combining this with careful interpretation of the output empowers you to manage your storage with precision.