Find the Largest Files on Your Mac (Simple Script & Tools)
Find and delete large files on your Mac with a free Bash script, Finder search, mdfind, and ncdu. Free up storage on macOS Sequoia & Tahoe with safe cleanup tips.

Running out of disk space on your Mac but can’t figure out where it all went? You’re not alone. Apple’s own storage tools in macOS Sequoia and Tahoe give you a high-level overview but often hide the real culprits: orphaned AI models, Time Machine snapshots, and APFS clones that report misleading sizes. Third-party “disk cleaner” apps charge subscriptions for what a few terminal commands can do for free.
This guide covers five ways to find large files on Mac: a zero-setup Finder search, the instant mdfind Spotlight CLI, an improved Bash script for full system scans, modern interactive CLI tools, and the hidden space eaters that most guides ignore. Everything here works on macOS Sequoia 15.x and Tahoe (macOS 26).
Apple Intelligence uses ~7 GB of disk space
macOS Sequoia 15.3+ stores Apple Intelligence assets locally. You can see the storage usage in System Settings > General > Storage (click the info icon next to macOS). Terminal-based methods like the script below still give you the full picture of everything eating your disk, including files System Settings won’t show.
If you’re looking for free Mac apps beyond disk cleanup, check toolhunt.net mac apps section.
Quick method: Finder search (no Terminal needed)
The simplest way to find large files uses Finder’s built-in search. No Terminal, no scripts, no installs. This is enough for most casual cleanup.
- Open Finder and press
Cmd + F - Click “This Mac” to search the entire drive (not just the current folder)
- Click the first dropdown → select “File Size”
- Set the condition to “is greater than”
- Enter a threshold:
1 GB(adjust to 500 MB for smaller drives, or 5 GB if you only want the biggest offenders) - Click the “Size” column header to sort results largest-first
Threshold tips
Finder search has limits: it won’t show hidden directories (~/Library, ~/.ollama), system files, or files inside app bundles. For those, you need Terminal methods.
Spotlight CLI: mdfind for instant results
mdfind queries the Spotlight index, making it near-instant compared to walking the filesystem with find. It’s the fastest way to locate large files if Spotlight indexing is enabled.
# Find all files > 1 GB using Spotlight index (near-instant)
mdfind "kMDItemFSSize > 1000000000" -onlyin ~/ 2>/dev/null | \
while IFS= read -r f; do
stat -f '%z %N' "$f" 2>/dev/null
done | sort -rn | head -20# Find all files > 500 MB in your home directory
mdfind "kMDItemFSSize > 500000000" -onlyin ~/ 2>/dev/null | \
while IFS= read -r f; do
stat -f '%z %N' "$f" 2>/dev/null
done | sort -rn | head -20The output shows byte sizes and full paths, sorted largest-first. You can pipe it through numfmt --to=iec for human-readable sizes, though stat on macOS doesn’t have the GNU numfmt by default.
Check Spotlight status first
mdfind returns empty or incomplete results, Spotlight may be disabled or rebuilding. Check with:mdutil -s /If it says indexing is disabled, re-enable it with:
sudo mdutil -E /Rebuilding the index takes 10-30 minutes depending on drive size.
Caveat: mdfind only finds files that Spotlight has indexed. Some system directories and external drives may not be indexed. For a comprehensive scan, use the Bash script below.
The Bash script: full system scan
This is the core method — an improved macOS-optimized script that scans your filesystem, reports disk usage, and lists the largest files. The original version of this script had issues with modern macOS permissions and scanned external drives. This version fixes both.
Prerequisites: Full Disk Access
Since macOS Mojave (10.14), even sudo can’t access certain user directories without Terminal having Full Disk Access. Without it, the script silently skips entire directory trees. The 2>/dev/null hides the “Operation not permitted” errors.
Required: Full Disk Access
Grant Full Disk Access:
- Open System Settings > Privacy & Security > Full Disk Access
- Click the + button
- Navigate to
/Applications/Utilities/Terminal.app(or your terminal of choice, like Ghostty or WezTerm) - Toggle it ON
- Quit and reopen the terminal for changes to take effect
- macOS 12 (Monterey) or later
- Terminal.app (or Ghostty/WezTerm) added to Full Disk Access
- Homebrew installed (needed later for CLI tools like
dustandgdu). Install from brew.sh.
The improved script
Key changes from the original:
- Scans your home directory by default (where most user files live), with
--allflag for power users - Uses
-xto stay on one filesystem (won’t wander into external drives or network mounts) - Excludes noisy directories that waste scan time
- Safer output parsing with
IFS=$'\t' - Adds a Time Machine snapshot check at the end
#!/bin/bash
# Find the largest files on your Mac
# Usage: ./find_large_files.sh [number_of_files]
# ./find_large_files.sh --all [number_of_files] (scan entire system)
# Parse arguments
scan_path="$HOME"
num_files=20
if [[ "$1" == "--all" ]]; then
scan_path="/"
shift
fi
if [[ -n "$1" && "$1" =~ ^[0-9]+$ ]]; then
num_files=$1
fi
# Print disk space information
echo "==========================================="
echo "DISK SPACE INFORMATION"
echo "==========================================="
df -h "$scan_path" | awk 'NR==2 {
printf "Total Space: %s\n", $2
printf "Used Space: %s\n", $3
printf "Free Space: %s\n", $4
printf "Usage: %s\n", $5
}'
echo "==========================================="
echo
# Build exclusion list. Skip directories that waste time or produce noise
excludes=(
-not \( -path "/System/*" -prune \)
-not \( -path "/Volumes/*" -prune \)
-not \( -path "/private/var/vm/*" -prune \)
-not \( -path "/private/var/folders/*" -prune \)
-not \( -path "*/Library/Caches/*" -prune \)
-not \( -path "*/Library/Containers/*" -prune \)
-not \( -path "*/node_modules/*" -prune \)
)
echo "Searching for the $num_files largest files..."
echo "Scanning: $scan_path"
echo "This may take a minute on large drives."
echo
# Create temporary file for results
tmp_file=$(mktemp)
# Run the scan. -x keeps us on one filesystem
# sudo is needed when scanning / or other users' directories
if [[ "$scan_path" == "/" ]]; then
sudo find "$scan_path" -x "${excludes[@]}" \
-type f -print0 2>/dev/null | \
xargs -0 du -h 2>/dev/null | \
sort -rh | \
head -n "$num_files" > "$tmp_file"
else
find "$scan_path" -x "${excludes[@]}" \
-type f -print0 2>/dev/null | \
xargs -0 du -h 2>/dev/null | \
sort -rh | \
head -n "$num_files" > "$tmp_file"
fi
# Print formatted results
echo "==========================================="
echo "TOP $num_files LARGEST FILES"
echo "==========================================="
echo
printf "%-8s | %s\n" "Size" "File Path"
echo "-------------------------------------------"
while IFS=$'\t' read -r size file; do
printf "%-8s | %s\n" "$size" "$file"
done < "$tmp_file"
echo "==========================================="
rm "$tmp_file"
# Check for Time Machine local snapshots
echo
echo "==========================================="
echo "TIME MACHINE LOCAL SNAPSHOTS"
echo "==========================================="
snapshots=$(tmutil listlocalsnapshots / 2>/dev/null)
if [[ -n "$snapshots" ]]; then
count=$(echo "$snapshots" | wc -l | tr -d ' ')
echo "Found $count local snapshot(s). These are invisible to find/du:"
echo "$snapshots" | head -5
if (( count > 5 )); then
echo " ... and $((count - 5)) more"
fi
echo
echo "To reclaim this space: sudo tmutil thinlocalsnapshots / 999999999999 4"
else
echo "No local snapshots found."
fi
echo "==========================================="
echo
echo "Scan complete!"
Run the script step-by-step
-
Open Terminal. Find it in Applications > Utilities or press
Cmd + Spaceand type “Terminal”. If you want a better terminal experience, consider setting up Fish shell on macOS for better autocomplete and syntax highlighting. -
Create the script file:
nano ~/find_large_files.shPaste the script above, then save with
Ctrl + X,Y,Enter. -
Make it executable:
chmod +x ~/find_large_files.sh -
Run it:
# Scan your home directory (default, no sudo needed)
./find_large_files.sh
# Show top 30 files instead of 20
./find_large_files.sh 30# Scan the entire system (requires sudo for /System, /private, etc.)
./find_large_files.sh --all
# Full scan, top 50 files
./find_large_files.sh --all 50When running a full system scan, you’ll be prompted for your password. The scan takes 1-5 minutes depending on drive size and whether you have external drives connected.
df vs du: why the numbers don't always match
df (filesystem-level view) while the file list uses du (sums individual file sizes). On APFS, these numbers can differ significantly due to clones, sparse files, and purgeable space. See the “Hidden Space Eaters” section below. Don’t panic if the math doesn’t add up.For long scans, consider running it inside a tmux terminal multiplexer so you can detach and come back later.
Sample output (home directory scan):
===========================================
DISK SPACE INFORMATION
===========================================
Total Space: 460Gi
Used Space: 95Gi
Free Space: 341Gi
Usage: 22%
===========================================
Searching for the 20 largest files...
Scanning: /Users/dragos
This may take a minute on large drives.
===========================================
TOP 20 LARGEST FILES
===========================================
Size | File Path
-------------------------------------------
13G | /Users/dragos/.diffusionbee/downloaded_assets/FLUX.1-schnell_flux_schnell_q5p_NNC_all.sqlite
13G | /Users/dragos/.diffusionbee/downloaded_assets/FLUX.1-dev_flux_dev_q5p_NNC_all.sqlite
8.4G | /Users/dragos/.ollama/models/blobs/sha256-6e41c39f4490a9e8b7a65916425c6ed97f04ed95bab991c4ab6a462ff84d1608
1.9G | /Users/dragos/.ollama/models/blobs/sha256-dde5aa3fc5ffc17176b5e8bdc82f587b24b2678c6c66101bf7da77af9f7ccdff
949M | /Applications/DaVinci Resolve/DaVinci Resolve.app/Contents/MacOS/Resolve
...
===========================================
TIME MACHINE LOCAL SNAPSHOTS
===========================================
Found 3 local snapshot(s). These are invisible to find/du:
com.apple.TimeMachine.2025-01-09-183042.local
com.apple.TimeMachine.2025-01-09-193042.local
com.apple.TimeMachine.2025-01-09-203042.local
To reclaim this space: sudo tmutil thinlocalsnapshots / 999999999999 4
===========================================
If the output shows mostly /System or /Volumes paths, the -x flag or exclusions aren’t working. Check that you’re running the updated script, not the old version.
Verify: The disk info header should show your actual drive size and usage. The file list should contain user-level paths (home directory, Applications), not system internals.
Modern CLI tools: dust, gdu & ncdu
If you find yourself running disk cleanup regularly, a one-shot script isn’t the best tool. These three CLI utilities give you interactive, browsable views of disk usage, much better for exploring and deleting on the fly.
All three install via Homebrew:
dust - Rust-based tree view (12k ★)
brew install dustdust shows the largest directories and files as a proportional tree visualization. It’s fast (Rust-based) and the output is immediately readable without navigating a TUI.
dust ~/ # full home directory tree
dust -F ~/ # files only, no directory summaries
dust -n 30 ~/ # show top 30 entries
dust -d 2 ~/ # limit depth to 2 levels (quick overview)GitHub: bootandy/dust, 12k stars, actively maintained.
gdu - Go-based interactive TUI (5.9k ★)
brew install gdugdu is a fast interactive disk analyzer with arrow-key navigation. It uses parallel processing, making it significantly faster than ncdu on SSDs. You can navigate into directories and delete files directly.
gdu ~/ # interactive mode. Arrow keys to navigate, 'd' to delete
gdu -t 20 ~/ # non-interactive: top 20 largest itemsGitHub: dundee/gdu, 5.9k stars, Go-based.
ncdu - the classic
brew install ncduncdu (NCurses Disk Usage) has been the go-to TUI disk analyzer for over a decade. It’s slower than gdu on modern SSDs but it’s available everywhere: Linux, BSD, macOS. The interface is familiar to most sysadmins.
ncdu ~/ # scan and browse interactively
ncdu -x / # scan root filesystem, don't cross mount pointsWhich one to use?
If you spend a lot of time in the terminal, you can supercharge your Fish shell with plugins for better tab completion on these commands.
Where is my “missing” disk space?
You ran df and it says 200 GB used. You ran du on your home directory and it only adds up to 120 GB. Where did the other 80 GB go? On APFS (the default filesystem since High Sierra), the answer is usually one of three things.
Time Machine local snapshots
Time Machine stores hourly local snapshots directly on your startup disk. These can consume tens of GB but are completely invisible to find, du, and Finder. They don’t show up as files because they’re filesystem-level snapshots.
# Check if snapshots are eating your space
tmutil listlocalsnapshots /
# If you see many snapshots and need space now:
sudo tmutil thinlocalsnapshots / 999999999999 4
The thinlocalsnapshots command tells macOS to purge local snapshots, freeing space immediately. The priority parameter (4) means “low priority.” It won’t interrupt other operations. These snapshots auto-delete when disk pressure occurs, but manual thinning is safe if you need space now.
Hidden snapshots can consume 50+ GB
tmutil if you’re mysteriously low on space. The snapshots are separate from your Time Machine backup drive — thinning local snapshots doesn’t affect your backups.APFS clones, sparse files & purgeable space
APFS has features that make du output misleading:
-
Clones:
cp -c(and many apps like pnpm, uv, git worktrees) creates copy-on-write clones.dureports the full size of every clone, but deleting one clone frees zero blocks if another clone exists. Anode_modulestree can report 20 GB indubut deleting it frees 3 MB. -
Sparse files: Docker’s
Docker.rawdisk image and VM images (UTM, Parallels) are sparse files. They report as 64 GB but only occupy the actually-written blocks (e.g., 9 GB). If you’re running Docker, see how to clean up Docker images and reclaim disk space. -
Purgeable space: macOS marks some files as purgeable (caches, local snapshots, iCloud-offloaded files). They count as “used” in
dubut macOS will auto-delete them when space is needed. You can check purgeable space with:diskutil info / | grep -i purgeable
df vs du: why the numbers don't match
If you’re generating locally AI images like Flux models, those model files can be 10-13 GB each — and DiffusionBee stores them in ~/.diffusionbee/downloaded_assets/.
What’s safe to delete (and what never to touch)
The script finds large files but doesn’t tell you what’s safe to remove. Here’s a practical guide organized by category.
AI models (Ollama, DiffusionBee)
Ollama models — stored in ~/.ollama/models/. Each model is 2-13 GB. Use the proper CLI to remove them (raw rm leaves orphaned blobs):
ollama list # see what's installed
ollama rm <model-name> # remove a specific modelSee the full Ollama setup guide for managing models properly.
DiffusionBee models — stored in ~/.diffusionbee/downloaded_assets/. These are the largest files on many Macs (13 GB each for FLUX models). You can delete the .sqlite files directly if you no longer use DiffusionBee.
Docker images and containers
Docker’s disk usage adds up fast. Check what’s consuming space:
docker system df # see Docker's disk usage breakdown
docker system prune -a # remove all unused images, containers, networks (careful!)
docker image prune # remove dangling images only (safer)Docker’s Docker.raw disk image (in ~/Library/Containers/com.docker.docker/) can be 50+ GB as a sparse file. Its reported size vs. actual disk usage will differ. See the full Docker cleanup guide for a detailed walkthrough.
Developer tool caches
These are all safe to delete — they regenerate on next use:
# Homebrew cache (old downloads)
brew cleanup -s
# npm cache
npm cache clean --force
# pip cache
pip cache purge
# yarn cache
yarn cache cleanProject-level directories safe to delete (they rebuild):
node_modules/— runnpm installto regenerate.venv/orvenv/— runpython -m venv .venvto recreate.next/— Next.js build cache, regenerates onnpm run buildtarget/— Rust build output, regenerates oncargo build__pycache__/— Python bytecode, regenerates automatically
Xcode leftovers
If you’ve ever had Xcode installed, old device support files pile up:
# Old iOS/tvOS/watchOS device support (can be many GB)
rm -rf ~/Library/Developer/Xcode/iOS\ DeviceSupport/*
# Old Xcode caches
rm -rf ~/Library/Developer/Xcode/DerivedData/*
# Old simulator data
xcrun simctl delete unavailableNever delete these
•
/System — macOS system files•
/usr (except /usr/local) — system binaries•
/Library/Extensions — kernel extensions•
/Library/PreferencePanes — system preference panes• Any file you can’t identify in a system directory
When in doubt, don’t delete it. Move it to Trash first and see if anything breaks before emptying.
If you’re unsure whether two directories contain the same content before deleting one, you can compare folder contents in Terminal to check.
Related terminal tools
If you’re spending time in Terminal for disk cleanup and system management, these tools make the experience better:
- Ghostty — modern, GPU-accelerated terminal emulator for macOS
- WezTerm — terminal with built-in tmux-like multiplexing
- tmux — terminal multiplexer for long-running scans and multiple sessions
- Fish shell — better default shell with autosuggestions and syntax highlighting
- cmux — AI-assisted terminal sessions for power users
Conclusion
You don’t need paid apps to find and manage large files on your Mac. Between Finder search for quick checks, mdfind for instant results, the Bash script for comprehensive scans, and dust/gdu/ncdu for interactive exploration, you have everything you need.
The real disk hogs are usually AI models (Ollama, DiffusionBee, Stable Diffusion), Docker images, Time Machine local snapshots, and dev project caches. Run the script once a month or whenever you see the “Your disk is almost full” warning. Apple charges $0.99/month for 50 GB of iCloud storage — but cleaning up local files is free.
Back to TopFAQ
Why does df show different free space than du?
df reports filesystem-level usage — what the kernel sees. du sums individual file sizes. On APFS, these diverge because of:
- Clones — copy-on-write duplicates that share blocks until modified
- Sparse files — files that report a larger size than their actual allocated blocks
- Purgeable space — files macOS marks as deletable under disk pressure
Trust df for “how full is my disk” and du for “which files are biggest.” They answer different questions.
Do I need to grant Full Disk Access to Terminal?
Yes, since macOS Mojave (10.14). Without it, even sudo cannot access ~/Library, Mail, Messages, Photos, and other protected directories. The script will silently skip these paths.
Go to System Settings > Privacy & Security > Full Disk Access, add your terminal app (Terminal.app, Ghostty, WezTerm, etc.), then quit and reopen the terminal.
What's the fastest way to find large files?
Depends on what you need:
- Just a few big files? Use Finder search (
Cmd+F, filter by File Size > 1 GB). Zero setup. - Fast terminal search?
mdfind "kMDItemFSSize > 1000000000"— queries the Spotlight index, near-instant. - Full system scan? The Bash script in this guide — comprehensive but takes 1-5 minutes.
- Interactive browsing? Install
dustorgduvia Homebrew — best for exploring and deleting interactively.
Can I delete Time Machine local snapshots?
Yes. Local snapshots are stored on your startup disk and are separate from your Time Machine backup drive. Deleting them doesn’t affect your backups.
# List snapshots
tmutil listlocalsnapshots /
# Thin them (reclaim space)
sudo tmutil thinlocalsnapshots / 999999999999 4macOS also auto-deletes local snapshots when disk pressure occurs, but manual thinning is safe if you need space immediately.
Is the script safe to run on macOS Tahoe?
Yes. The script uses standard POSIX tools (find, du, df, sort) and the -x flag, all of which work on macOS Sequoia 15.x and the upcoming Tahoe (macOS 26). The exclusion paths and Full Disk Access requirement are the same across both versions.


