How to Clear Temp Files on Mac Featured Image

How to Clear Temp Files on Mac: 4 Tried and Tested Methods

Clear temp files on Mac efficiently to free up space.

Written by

Reviewed by

Last updated: December 29, 2024

Expert verified

SVG Image

TL;DR

To clear temp files on Mac:

  1. Clear Browser Data: For Chrome, go to More Tools > Clear browsing data. For Safari, enable the Develop menu and click Empty Caches. In Firefox, open Settings > Privacy & Security > Clear Data.
  2. Remove App Caches: Go to ~/Library/Caches in Finder and delete cache folders for specific apps.
  3. Delete Logs: Go to ~/Library/Logs in Finder and remove log file contents, or use sudo rm -rf /private/var/log/* in Terminal.
  4. Reset Settings: Navigate to System Settings > General > Transfer or Reset, then select Erase All Content and Settings.

Tried and Tested ✅: The methods and steps mentioned in this article have been tried and tested firsthand by Ojash Yadav on his MacBook Pro M3 and rechecked for errors on Hashir’s MacBook Air M2.

Has your Mac been feeling sluggish lately? I ran into the same issue and found out that hidden temp files were the main culprit. Now I’ll show you how I cleared them out—quickly and easily—so you can get your Mac running smoothly again.

What Are Temp Files on Mac?

Temp files (short for temporary files) are created whenever your Mac performs tasks or processes. They help apps, system services, and macOS store data for a short time, but can pile up if you don’t clear them regularly.

Some common temp files on Mac include the following:

Type of Temp FilesDescription
🚀 Application CacheFiles saved by apps to speed up loading times and enhance the user experience.
💾 System CacheFiles created by macOS and system processes to improve performance.
🌐 Browser CacheImages, cookies, and website files that help webpages load faster.
📋 Log FilesRecords of system and app events, errors, and diagnostics.
📥 Downloaded FilesFiles from apps, installers, or system updates that may no longer be needed.
📧 Mail AttachmentsAttachments your email client has downloaded and stored locally.
📱 Old iOS Backup FilesBackups from previous iOS devices that may still be lurking on your Mac.
Partial DownloadsIncomplete or interrupted downloads that can clutter your drive.

How to Find the Main Temporary Folder on Your Mac

Here’s how to find the main temporary folder on your Mac:

  1. Launch Terminal via Spotlight search (Command ⌘ + Spacebar).
type terminal in spotlight search
  1. In the Terminal, type the following command and press Enter:
open $TMPDIR
type open TMPDIR in terminal
  1. This will open the main temporary folder on your Mac.
main temporary files folder on mac

Besides the main temporary folder, your Mac contains additional temporary directories, which can be found at:

/tmp
/private/var/tmp
/private /var/at/tmp
/private/var/spool/cups/tmp

Moreover, caches, which are part of temporary files, are located in the Caches folder within the user directory. These caches store temporary files for your applications.

How to Clear Temp Files on Mac Automatically

Manually clearing temp files can free up space and speed up your Mac, but it can also disrupt some apps until they rebuild their caches. That’s where third-party apps shine. I recommend MacKeeper, because it clears temp files with one click—quickly, safely, and hassle-free.

Here’s how to clear temp files on Mac using mackeeper’s Safe Cleanup feature:

  1. Download and install MacKeeper on your Mac.
  2. Launch MacKeeper and go to the Safe Cleanup tab.
click safe cleanup under the cleaning section
  1. Click Start Scan and wait for the results.
click start scan in safe cleanup
  1. Review the items you want to remove. Select them individually or click Check All.
select junk files to remove or click check all
  1. Next, click Clean Junk Files.
tap clean junk files
  1. This will clear temp files on Mac, and you’ll get a Cleaning Completed notification on your screen. Click Rescan to repeat the process.
click rescan to scan the system again

How to Clear Temp Files on Mac Manually

Here is the step-by-step guide to clear temp files on Mac Manually:

1. Clear Web Cache Files

Web browsers store temporary data like images and cookies to speed up page loading. Over time, these files build up and can slow things down. Here is how to clear browser cache on Mac:

a. Clear Browser Cache Files on Chrome

To clear the cache on Google Chrome on Mac, you can follow these steps:

  1. Open Chrome and click the three vertical dots in the upper right-hand corner of the window.
click the three dots in the right corner
  1. Select More Tools and then Clear browsing data from the drop-down menu.
click more tools and select clear browising data
  1. Select the time range you want to clear the cache in the Clear browsing data pop-up window. If you want to clear everything, select All time.
select all time from the drop down menu
  1. Check the box next to Cached images and files and uncheck all other boxes unless you want to clear other types of browsing data.
check the box next to cached images and files and uncheck all other boxes
  1. Click Clear data to clear the cache.
click clear data to clear the cache

b. Clear Browser Cache Files on Safari

To clear Safari cache on Mac, follow these steps:

  1. Open Safari on your Mac, click Safari in the menu bar at the top, and select Settings from the drop-down menu.
click safari in the top menu bar and select settings
  1. In the Settings window, click the Advanced tab.
in the settings window click the advanced tab
  1. At the bottom of the Advanced tab, check the box next to the Show Develop menu in menu bar.
check the box next to the show develop menu in menu bar
  1. You’ll see Develop in the menu bar. Click it and select Empty Caches from the drop-down menu.
click develop in the menu bar and select empty caches

c. Clear Browser Cache Files on Firefox

To clear the cache on Firefox on a Mac, follow these steps:

  1. Open the Firefox browser on your Mac and click the three horizontal lines (menu icon) in the top-right corner.
  1. Click Settings from the drop-down menu.
click three lines at top right corner of screen and select settings
  1. In the left-hand menu, click Privacy & Security.
click privacy security in the left hand menu
  1. Scroll to the Cookies and Site Data section and click the Clear Data button.
click the clear data button under cookies and site data section
  1. In the pop-up window, check the box next to Cached Web Content. You can check the box next to Cookies and Site Data if you want to clear those as well. Then, click the Clear button to clear the cache.
click the clear button to clear the cache 1

2. Clear the App Cache Manually

Mac apps store temporary data to boost performance and load times. But if these files become cluttered, they can lead to freezing or crashing. To clear the app cache on a Mac, follow these steps:

Clearing the app cache may delete some of your settings or preferences. You may need to set them up again the next time you use the app.

  1. Click the Finder icon in the Dock to open a Finder window.
click finder in your dock
  1. In the menu bar, click Go and then Go to Folder.
click go in the menu bar and select go to folder
  1. In the Go to Folder window, type the following path:
~/Library/Caches/
  1. Select the Caches folder from the options.
type library caches in the window
  1. Locate the folder for the application you want to clear the cache for. If you’re not sure which folder belongs to the app, look for folders with the same name as the app.
  2. Right-click the folder and select Move to Bin from the menu.
right click the folder and select move to bin from the menu
  1. Click Empty Bin to delete the folder permanently.
right click the bin and select empty bin

3. Remove System Log Files

System log files record important events on your Mac. If you don’t clear them regularly, they can hog space and reduce performance. There are two methods to do so:

a. Manually Deleting Log Files

You can manually delete log files by following these steps:

  1. Open Finder from your Dock.
click finder in your dock
  1. Click Go in the menu bar and select Go to Folder.
click go in the menu bar and select go to folder
  1. Type the following path in the window and press Enter:
~/Library/Logs
type library logs
  1. You’ll see a list of all your log files. To remove a file, delete the folder contents instead of dragging the folder to the Bin.
select the folder contents and tap move to bin
  1. Once you have moved the files to the Bin, right-click the Bin icon in your Dock and click Empty Bin to delete the log files permanently.
right click the bin and select empty bin

b. Using Terminal App

You can also use the Terminal app to remove system log files on your Mac. Follow the exact steps below:

Be cautious when using Terminal, as incorrect commands can cause issues with your system and always back up your data before using Terminal.

  1. Click the magnifying icon in the menu bar to open Spotlight search or press Command ⌘ + Spacebar.
click the magnifying icon in the menu bar at the top
  1. Type Terminal in the Spotlight search and press Enter.
type terminal in spotlight search
  1. Now, enter this command and hit Enter:
sudo rm -rf /private/var/log/*
enter a command and press enter
  1. Type your Mac’s password and let the command execute.
type your mac s password

4. Reset System Settings

System settings can conflict with apps over time, causing slow performance or glitches. Resetting them can help, but it also erases all data—so back up first. To reset system settings on a Mac, follow these steps:

Erasing all content and settings will remove all data, settings, and user accounts from your Mac. So, I strongly suggest you back up your important Mac data before proceeding with this step.

  1. Click the Apple icon in the top-left corner of your screen and select System Settings.
click the apple icon and select system settings
  1. Click General in the left sidebar and select Transfer or Reset on the right.
click general and select transfer or reset
  1. Click the Erase All Content and Settings button.
click the erase all content and settings button
  1. Enter your MacBook password and click Unlock.
enter your macbook password and click unlock

Keep Your Mac Free From Temp Files

Now that you know how to delete temp files in Mac, you may want to optimize your Mac further to improve its performance. Here are some steps to free up space on your Mac and enhance its speed:

Frequently Asked Questions

Where are temporary files stored on Mac?

Temporary files are stored on Mac in a variety of locations, depending on the application you are using. Some common locations include the user’s ~/Library/Caches/ directory, /var/folders/, and /private/var/tmp/.

Which temp Mac files are safe to delete?

Knowing which temp Mac files are safe to delete is challenging, especially if you’re unfamiliar with the Mac file system. It’s best to use a third-party app, like MacKeeper, to manage your disk space if you’re unsure whether a temp Mac file is safe to delete.

Can I delete a temporary Mac file that’s still in use?

No, you cannot delete a temporary Mac file that’s still in use. macOS shows an error message if you try to delete such a temp file.

How often should I delete temp Mac files?

You should delete temp Mac files regularly if you experience performance issues or have low disk space. It would be best to set up a schedule to clean these files every few weeks automatically.

Can I recover deleted temporary Mac files?

Yes, you can recover deleted temporary Mac files. Click the Bin icon in the Dock and look for the files you want to recover. Then, right-click the items and select the Put Back. You can also use third-party data recovery tools to retrieve your deleted temporary Mac files.

Ojash

Author

Hi there! I'm Ojash, a tech journalist with over a decade of experience in the industry. I've had the privilege of contributing to some of the world's largest tech publications, making my mark as a respected Mac expert. My passion lies in exploring, using, and writing about MacBooks, and I enjoy sharing my expertise to help others make informed decisions and get the most out of their MacBook experience. Join me as we delve into the fascinating world of MacBooks together!

Hashir Ibrahim

Reviewer

Hello! I'm Hashir, a seasoned tech journalist with a unique blend of academic expertise and hands-on experience. With a bachelor's in IT, a master's in cybersecurity, and over a decade in the industry, I've built a reputation for demystifying complex Apple hardware. My work has been featured in top tech outlets like MakeUseOf and MakeTechEasier. As the senior writer at MacBook Journal, I write guides that help you solve any issues you have with your mac.

Total
0
Shares
You May Also Like