
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.
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
- Open Finder.
- Click Go > Go to Folder.
- Type ~/Library/Caches and press Return.
- Delete folders/files inside, but not the folder itself.
- Repeat for /Library/Caches.
- 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
- Go to ~/Library/Logs/.
- Delete old or large logs.
- For system logs: /Library/Logs/.
#3 Clear Mail Downloads
- Go to ~/Library/Containers/com.apple.mail/Data/Library/Mail Downloads/.
- Delete all files and folders.
#4 Remove Browser Cache
Safari:
- Open Safari > Settings > Privacy.
- Click Manage Website Data.
- Remove all data or selectively delete items.
Chrome:
- Go to Chrome > Settings > Privacy and Security.
- Select Delete Browsing Data.
- Choose Cached images and files.
Firefox:
- Go to Settings > Privacy & Security.
- 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.
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:
- Click the Apple Menu in the top-left corner of your screen.
- Select "About This Mac."
- Click on the "Storage" tab.
- 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:
- Open Disk Utility from Utilities via Applications.
- Select your primary disk (e.g., Macintosh HD).
- Click "First Aid" and run a scan.
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:
- Go to Applications > Utilities > Activity Monitor.
- Sort processes by "Memory" or "Disk".
- 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.
Step 3. Select the junk data you want to delete, click on Clean button.
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
- Open Automator
- Choose Application
- Add "Get Specified Finder Items"
- Add cache/log folders to target
- Add "Move Finder Items to Trash"
- 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:
- Open Finder
- Press Cmd + F
- Choose "File Size is greater than..."
- 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.


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.
Related Articles
- Jul 08, 2025How to Uninstall Applications on macOS Tahoe 26?
- Apr 18, 2025How to Clean Up Junk Data on Mac Studio – Guide 2025
- Oct 24, 2024How to Clear Chrome Data on Mac?
- Aug 06, 2024How to Completely Uninstall Chrome on Mac?
- Sep 29, 2024Best 10 Mac Uninstaller to Remove Apps from Mac (macOS Sequoia Ready)
- May 20, 2025How to Find and Delete Duplicate Photos on Mac

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
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