Home > Wiki Tips

Where is Temp Folder on Mac and How to Delete Temporary Files on Mac?

Updated on Tuesday, August 27, 2024

iBoysoft author Jenny Zeng

Written by

Jenny Zeng
Professional tech editor

Approved by

Jessica Shee

English

Summary: This post explains everything you need to know about the tmp folder on Mac, including what it is, where the tmp directory is located on Mac, how to access it, and how to clean all temp files on Mac.

Tmp folder on Mac

There are several temporary folders on Mac containing temporary files used by the operating system and various Mac apps. Though these temp folders are not intended for average users to meddle, you may need to access or explore them for troubleshooting, data recovery, system administration, and other purposes.

Here, we will show you what the tmp folder is and how to access it.

Guide to tmp folder on Mac

What is tmp folder on Mac?

Tmp folder on Mac, also commonly referred to as temp folder or temporary folder, stores temporary files created by macOS and applications to hold data while a process or installation is ongoing. Some temporary files will be automatically removed by the daily maintenance scripts or the app/process that created them after a reboot, the relevant app is closed, or the files haven't been accessed after a few days.

Where is temp folder on Mac?

You can find the main temp or tmp folder on Mac by running the following command in Terminal.

  1. Launch Terminal from the Applications > Utilities folder.
  2. Type in the command below and hit Enter to locate the Mac temporary folder.echo $TMPDIR

Locate the main tmp folder on Mac using Terminal

This command should return you the temporary directory on Mac as something like "/var/folders/s9/yl377tk95k9353s3k1jpn4_80000gn/T/."

Besides, there are other tmp folders located in the root directory and its /private/ folder on a Mac.

Here's a quick summary of the major system-level tmp folders on Mac:

  • The path given by $TMPDIR. (It stores user-specific tmp files in a directory like /var/folders/s9/yl377tk95k9353s3k1jpn4_80000gn/T/)
  • /tmp (The /temp folder seats the same content as the /private/tmp folder, which is universal to all users and will be cleared after a reboot.)
  • /private/var/tmp (It's also known as /var/tmp. Unlike /tmp, it won't be cleared out on reboot.)
  • /private/var/at/tmp
  • /private/var/spool/cups/tmp

 /tmp vs. /var/tmp: /tmp is meant as fast storage for applications that need a place to create temporary files. The temporary files will be deleted whenever the system is rebooted. However, /var/tmp is normally located on a physical disk and holds temporary files for a longer time. Different from /tmp, it may not be available in the early boot process. Besides, files in the /var/tmp directory are preserved between system reboots.

In a broader sense, temporary folders also include ~/Library/Caches, whose subfolders contain different sorts of user-level temporary directories, such as:

  • ~/Library/Caches/TemporaryItems/ (Apps like Outlook save temp files under Outlook Temp.)
  • ~/Library/Caches/com.apple.appstore (This temp folder keeps the Mac App Store caches.)

Now that you know where to find the temp folder on Mac, don't forget to share it with your friends.

 

How to access tmp folder on Mac?

You can quickly access the main temporary folder by using the "open" command and pointing it at the environmental variable $TMPDIR by executing the command below in Terminal.

open $TMPDIR

How to access tmp folder on Mac through Terminal

To access other temporary folders on Mac, you can go through the steps below:

  1. Open Finder.
  2. Click Go > Go to Folder at the top menu bar.
  3. Copy and paste the temporary folder path we mentioned above and hit Enter. (e.g., /private/var/tmp) 
    Access private var tmp folder on Mac

How to delete temporary files on Mac?

You shouldn't manually delete any files from the system-level temporary folders on Mac, as you may accidentally lose some important data for the app to work correctly and even break the system. If the temp folder on Mac is taking up space, you can reboot your Mac to clear them out. If, for some reason, you have to delete temp files on Mac manually, remember to back them up first.

On the contrary, it's safe to delete the user-level caches and temporary files in the Caches folder for space saving or troubleshooting issues of a specific app.

If you want to free up space on Macintosh HD, you can delete all the subfolders except the main Caches folder. If a specific cache file is likely corrupt, causing issues on a related app, delete the regarding folder only. You can follow the steps below to clear caches on Mac.

How to clean temp files on Mac:

  1. Close all running apps.
  2. Open Finder.
  3. Pull down the Go menu at the top and hold the Option key to unhide the hidden Library folder.
  4. Click Library.
  5. Open the Caches folder.
  6. Choose which caches and temporary files to clear, or select all temp folders.
  7. Right-click the chosen temporary folder on Mac and select "Move to Trash." 
    How to delete tmp files on Mac
  8. Empty the Trash.

Please share this post to help others know how to delete temp files in MacBook.