How to Delete Temporary Files on Mac: A Complete Guide

Maria
Written byMariaUpdated on Jul 27, 2025
Gerhard Chou
Approved byGerhard Chou

Table of Contents

Before we start: There are many ways to delete temporary files on Mac. DMcleaner for Mac is the best method. It can quickly scan the Mac system and find all useless caches and temporary files. Then you delete all of them by only 1 click.

PAGE CONTENT:

Your Mac accumulates temporary files over time - caches, logs, browser data, and more - that can slow down your system and eat up valuable storage. While macOS is efficient at managing system resources, it doesn't always clean up temporary files automatically. Knowing how to delete them manually or with the help of built-in tools or third-party apps can significantly improve performance, reclaim disk space, and enhance your privacy.

In this article, we'll explain what temporary files are, why and when you should delete them, and step-by-step methods - both manual and automated - for safely cleaning them up.

clean up temporary files

What Are Temporary Files on macOS?

Temporary files are created by the system or applications to store data that is only needed for a short time. These files can include:

  • System cache files – created by macOS to speed up processes.
  • User cache files – generated by apps during normal usage.
  • Log files – records of system or application events and crashes.
  • Browser cache – includes saved web files to speed up browsing.
  • App-generated temp files – such as files from Xcode or Mail attachments.

Over time, these files can take up gigabytes of storage and bog down your system.

Types of Temporary Files on Mac

1. System Cache Files

Stored in /Library/Caches, these are created by macOS itself to optimize processes like Spotlight indexing and software updates.

2. User Cache Files

Found in ~/Library/Caches, these are generated by user-installed apps like Adobe Photoshop, Spotify, and Chrome.

3. Application Logs and Crash Reports

Stored in ~/Library/Logs, these track app and system activity and crash data.

4. Browser Cache

Cached website data improves page load times but can accumulate quickly. Each browser (Safari, Chrome, Firefox) stores this data differently.

5. Mail Attachments Cache

Apple Mail stores all opened attachments locally in:

~/Library/Containers/com.apple.mail/Data/Library/Mail Downloads/

6. Xcode Derived Data

If you're a developer using Xcode, this folder (~/Library/Developer/Xcode/DerivedData/) can grow to several gigabytes.

7. iCloud Temporary Files

Some offline cache files for iCloud Drive can be considered temp files, especially if they're no longer needed.

Why Delete Temporary Files on Mac?

There are several benefits to cleaning out temporary files on a regular basis:

  • Free up valuable storage space

    Especially useful on Macs with limited SSD storage.

  • Improve system performance

    Clearing large or corrupted caches can reduce lags and application crashes.

  • Enhance privacy

    Logs and browser caches can contain sensitive information.

  • Fix app or system bugs

    Deleting corrupt temporary files often resolves issues.

How to Delete Temporary Files on Mac Manually?

Before proceeding, create a backup using Time Machine or another backup tool. Deleting the wrong files can affect macOS stability.

#1 Clear System and User Cache

  1. Open Finder.
  2. Click Go > Go to Folder.

    clean up temporary files

  3. Type ~/Library/Caches and press Return.

    clean up temporary files

  4. Delete folders/files inside, but not the folder itself.

    clean up temporary files

  5. Repeat for /Library/Caches.
  6. Empty trash bin.

💡 Tip: Don't delete unknown files if you're unsure. Focus on large or app-specific cache folders like com.google.Chrome or com.spotify.client.

#2 Delete Application Logs and Crash Reports

  1. Go to ~/Library/Logs/.

    clean up temporary files

  2. Delete old or large logs.

    clean up temporary files

  3. For system logs: /Library/Logs/.

    clean up temporary files

#3 Clear Mail Downloads

  1. Go to ~/Library/Containers/com.apple.mail/Data/Library/Mail Downloads/.
  2. Delete all files and folders.

    clean up temporary files

#4 Remove Browser Cache

Safari:

  • Open Safari > Settings > Privacy.
  • Click Manage Website Data.

    clean up temporary files

  • Remove all data or selectively delete items.

Chrome:

  • Go to Chrome > Settings > Privacy and Security.

    clean up temporary files

  • Select Delete Browsing Data.
  • Choose Cached images and files.

    clean up temporary files

Firefox:

  • Go to Settings > Privacy & Security.

    clean up temporary files

  • Under Cookies and Site Data, click Clear Data.

#5 Empty Trash

Don't forget to right-click the Trash icon in your Dock and select Empty Trash.

clean up temporary files

Use Built-in macOS Tools to Clear Temporary Files

macOS provides several native tools that help users manage storage and remove unnecessary files safely - without the need for third-party software. While not all temporary files are exposed to users through these tools, a substantial portion can still be identified and deleted easily. Here's how to take full advantage of them:

#1 macOS Storage Management Tool (for macOS Monterey or Earlier)

The Storage Management tool, introduced in macOS Sierra and improved in later versions, provides a visual breakdown of disk usage. It recommends steps to reclaim space by removing unnecessary files such as old documents, trash contents, and temporary files like iTunes movies or Mail attachments.

How to Access It:

  1. Click the Apple Menu in the top-left corner of your screen.
  2. Select "About This Mac."
  3. Click on the "Storage" tab.

    clean up temporary files

  4. Choose the “Manage…” button next to your storage drive.

#2 Terminal Commands (Advanced Users)

For users comfortable with command-line tools, Terminal offers powerful and precise control over your system. Temporary system files, especially those in protected directories, can be cleaned up more aggressively via Terminal - though caution is strongly advised.

Useful Terminal Commands to Clear Temp Files:

1. Delete System Temp Files

sudo rm -rf /private/var/folders/*

This removes temporary files stored by macOS in obscure directories that don’t show up in Finder. These folders store transient cache files used by macOS and apps.

Caution: Do not run this command unless you fully understand what it deletes. Mistyped commands can delete critical files.

2. Flush DNS Cache (Optional for Networking Issues)

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

If you're facing browser slowdowns, clearing your DNS cache can help. This isn’t storage-saving but helps fix internet-related issues.

3. Clear User-Level Cache with Terminal

rm -rf ~/Library/Caches/*

This command removes all user cache files. Apps like Safari, Chrome, Spotify, and Adobe applications often store temporary resources here.

4. Check Folder Sizes Before Deleting

Before deleting large cache folders, you might want to check their size:

du -sh ~/Library/Caches/*

This command shows the size of each folder in the Caches directory, helping you determine which ones take up the most space.

#3 Disk Utility (For System Junk Cleanup)

Disk Utility doesn't directly clean temporary files, but you can use it to repair your disk permissions and file system, which often indirectly improves system performance, especially after removing caches.

Steps:

  1. Open Disk Utility from Utilities via Applications.

    clean up temporary files

  2. Select your primary disk (e.g., Macintosh HD).
  3. Click "First Aid" and run a scan.

    clean up temporary files

This process repairs corrupted file paths and orphaned cache data that may be clogging disk access.

#4 Activity Monitor (To Identify Cache-Heavy Apps)

If you want to know which apps are generating the most temporary files, use Activity Monitor:

  1. Go to Applications > Utilities > Activity Monitor.

    clean up temporary files

  2. Sort processes by "Memory" or "Disk".

    clean up temporary files

  3. Note apps with high disk or memory usage - they are likely storing large caches

Once identified, you can manually clean up these apps’ cache folders via ~/Library/Caches/[AppName].

Use Third-Party Cleaning Software (Optional)

Third-party apps offer automation and a user-friendly interface for removing junk files.

Popular Options:

  • DMcleaner for Mac – Smart cleanup, app uninstaller, duplicate cleaner, internet cleaner, etc.
  • CCleaner for Mac – Cache/log removal, browser cleaning
  • OnyX – Free maintenance and cleanup utility (advanced users)

Pros

  • One-click optimization
  • Scheduled cleanups
  • Visualization of storage usage

Cons

  • Potential cost
  • Risk with untrusted tools

👉 Important: Only use trusted software from developers with verified security practices.

Step 1. Download and install the reliable Mac cleaning software - DMcleaner for Mac.

Step 2. Open DMcleaner for Mac, choose Junk Cleaner, click on Scan button to find all types of caches and temporary files on Mac.

DMcleaner for Mac

Step 3. Select the junk data you want to delete, click on Clean button.

DMcleaner for Mac

How Often Should You Delete Temporary Files?

Suggested Frequency:

  • Weekly or Bi-weekly if you work with large files (video, design, development)
  • Monthly for general users
  • Before software upgrades or system diagnostics

Signs You Need to Clear Temp Files:

  • System feels sluggish
  • Apps crash frequently
  • Available storage is shrinking
  • Fans are running loud (high CPU usage from cache-heavy apps)

What You Should Not Delete

While cleaning, be cautious not to remove essential files:

  • Do not delete anything from /System/Library
  • Avoid removing unknown folders inside ~/Library
  • Kernel extensions, boot files, and system daemons must remain intact
  • Don't use wildcards (*) in Terminal unless you are 100% confident in the command

Automate Temporary File Cleanup

You can automate cleanup tasks using Automator or scripting.

Example: Automator Workflow

  1. Open Automator
  2. Choose Application
  3. Add "Get Specified Finder Items"
  4. Add cache/log folders to target
  5. Add "Move Finder Items to Trash"
  6. Save and run this app regularly

You can also use launchd and .plist files to schedule Terminal-based cleanup commands.

Bonus: Use Finder Search to Locate Large Temp Files

Use Finder’s search filters:

  1. Open Finder
  2. Press Cmd + F
  3. Choose "File Size is greater than..."
  4. Sort by size and investigate large files in Library, Caches, or Downloads

Final Tips and Recommendations

  • Always back up before deleting system files
  • Check app settings—some apps let you clear cache from within (e.g., Spotify or Adobe)
  • Update macOS—new updates may optimize file management
  • Monitor storage regularly—you can enable storage alerts via System Settings > Notifications

Conclusion

Deleting temporary files on your Mac is one of the simplest ways to regain storage space, speed up your system, and maintain digital hygiene. Whether you choose to clean files manually, use built-in macOS tools, or install a third-party app, the key is to be cautious and consistent. Done right, it can extend the life of your Mac and keep it running at peak performance.

By following the steps in this guide, you can confidently remove unnecessary files without compromising your system's stability.

logo stage

DMcleaner for Mac

Donemax DMcleaner for Mac is an award-winning Mac cleanup & maintenance application. It offers 10+ tools to help Mac users clean up junk data on Mac, uninstall unwanted apps & delete leftovers, shred files, delete duplicate files, free up disk space, speed up slow Mac, etc. It is also a smart switch manager for Mac, a powerful disk manager for Mac.

Maria
Contributing Writer

Maria

Maria is one of the senior writers & editors of Donemax who lives and works in Sydney, Australia. She loves PC, Mac and Internet Technology. She has 6 years of writing articles about data recovery on PC/Mac, disk cloning solution, data eraser and computer OS optimization, etc. She is also interested in testing various software and digital products.

Gerhard Chou
Editor in chief

Gerhard Chou

In order to effectively solve the problems for our customers, every article and troubleshooting solution published on our website has been strictly tested and practiced. Our editors love researching and using computers and testing software, and are willing to help computer users with their problems