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 4, 2023

Expert verified

SVG Image

TL;DR

To clear temp files on Mac, follow one of these methods:

  1. Use MacKeeper Safe Cleanup to remove all temp files in one click.
  2. Go to ~/Library/Caches and delete specific app cache files.
  3. Go to ~/Library/Logs in Finder and delete the contents of the log files or use the sudo rm -rf /private/var/log/* command to delete log files.
  4. Go to System Settings > General > Transfer or Reset and select Erase All Content and Settings to reset system settings.

Recently, my MacBook Air M2, 2022 started lagging a lot. I tried everything – closing apps, force-quitting programs, restarting the Mac – but nothing worked. Then I figured out the problem: too many temp files. It was shocking to see how many there were! After I cleaned these out, my Mac sped up a lot. So, I thought I’ll share how to delete temp files on Mac and get it running fast again.

Before We Begin

Junk and temp files occupy a lot of disk space and make your Mac slow and laggy. To improve your Mac’s performance and prevent excessive lag, download MacKeeper and clear temp files on Mac using its Safe Cleanup feature.

What Are Temp Files on Mac?

Temp files, short for temporary files, are generated on your Mac during various tasks and processes. These files are used by applications, system services, and the macOS itself to store data temporarily while performing operations.

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 user experience.
💾 System CacheFiles created by macOS and system processes for improved performance.
🌐 Browser CacheFiles, such as images and HTML, stored by browsers to speed up the loading of websites.
📋 Log FilesRecords of system and app events, errors, and diagnostics information.
📥 Downloaded FilesFiles downloaded by apps, installers, or system updates that may no longer be necessary after installation.
📧 Mail AttachmentsFiles received as email attachments and downloaded locally by your email client.
📱 Old iOS Backup FilesBackup files from previous iOS devices that are no longer needed, which can be created when syncing your iPhone or iPad with your Mac.
Partial DownloadsIncomplete downloads from browsers or download managers that may have been interrupted or paused.

How to Find the Main Temporary Folder on Your Mac

Temporary files on a Mac are stored in multiple locations, which can make it challenging to locate them. However, you can easily access the primary temporary folder using Terminal. Here’s how:

  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.

Now that you’re familiar with the locations of temporary files on your Mac, let’s see how to remove them.

Clear All Temporary Files In A Single Click Using MacKeeper

Why You Can Trust MacBook Journal verify badge We always conduct first-hand research and verify every method or solution we present, ensuring you receive reliable and effective advice. Learn more about our process.

Manually clearing temp files on your Mac can free up space and boost performance, but it might temporarily affect some apps until they create new cache files. That’s why I prefer MacKeeper over the manual methods for clearing temp files. It quickly and safely removes temporary files with just one click.

Here’s how to clear temp files in 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

What Else Can MacKeeper Do?

Besides clearing temporary files on Mac, MacKeeper is a great tool for cleaning junk files on your Mac, removing login items, and uninstalling unnecessary applications. Check out my detailed MacKeeper review to learn more about all its features.

Manually Clear Temp Files on Mac

I believe MacKeeper is safe, quick, and efficient in optimizing your Mac’s performance automatically, but if you prefer a more hands-on approach and want to manually clear temp files on Mac, I’ve shared the steps below.

1. Clear Web Cache Files

Web browsers store temporary data like images, cookies, and website files in a cache to enhance your browsing experience. However, these cached files can accumulate over time, leading to slow loading times and outdated content.

Clearing your browser cache on Mac regularly can resolve these issues. Below, you’ll see how to remove browser cache on Google Chrome, Safari, and Mozilla Firefox:

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 also have a cache that stores temporary data such as images, videos, and other files. This data improves the app’s performance and load times, but over time, the app cache can become cluttered and cause issues like freezing or crashing.

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.

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

  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 are essential to your macOS, but these log files can accumulate over time and take up significant space on your hard drive. If left unchecked, they may affect your Mac’s performance and even cause it to crash.

So, it’s essential to remove system log files to free up disk space and keep your Mac running smoothly. 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

Using Terminal is a sensitive method, so I would still suggest using third-party apps like MacKeeper to remove the system log files and clear temp files on Mac quickly and safely.

4. Reset System Settings

As you use your Mac, you may change system settings that could cause conflicts with other apps, leading to performance issues. Resetting Mac’s system settings can resolve various issues, such as slow performance, software glitches, or problems with the user interface.

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.

To reset system settings on a Mac, follow these steps:

  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

  1. 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/.

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

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

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

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

Hashir Ibrahim

Author

I'm Hashir, a tech journalist with a decade of experience. My work has been featured in some of the top tech publications like MakeUseOf and MakeTechEasier. I have a bachelor's degree in IT, a master's in cybersecurity, and extensive knowledge of Apple hardware, specifically MacBooks. As the senior writer at MacBook Journal, I write in depth guides that help you solve any issues you have with your mac and unbiased reviews that help you make the right buying decisions.

Ojash

Reviewer

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!

Total
0
Shares
You May Also Like