The Mac operating system has several system folders with temporary files that are used both by the system itself and by various programs. The 'temp' folder is not intended for user intervention, but sometimes advanced Mac users may need to access it.
In this article, we will explain where the 'temp' folders are located in Mac OS and how to access them.
This manual is intended for advanced Mac users only. We do not recommend looking for the 'temp' folders for no reason, let alone deleting any data from them. This can lead to serious system problems and data corruption or loss. If you need to clear temporary files for some reason, just restart your computer.
If you nevertheless deleted some files, then use our instructions on how to recover them.
How to find the 'Temp' folder in Mac OS
The easiest way to find the 'Temp' folder is through the command line.
1. Launch the Terminal program from the utilities folder and use the following command:
echo $ TMPDIR
2. You will get the location of the temporary files folder.
The output from the $ TMPDIR command might look something like this:
$ echo $ TMPDIR / var / folders / g7 / 7du81ti_b7mm84n184fn3k910000lg / T /
In this case, the location of the 'temp' folder will be as follows:
/ var / folders / g7 / 7du81ti_b7mm84n184fn3k910000lg / T /
You can also use the 'printenv' command:
printenv | grep TMP
It will also display the location of the TMPDIR like this:
TMPDIR = / var / folders / g7 / 2du11t4_b7mm24n184fn1k911300qq / T /
How to open the 'Temp' folder in Mac OS
You can immediately open the 'Temp' folder in a new Finder window using the 'open' command.
1. In the Terminal program, enter the following command:
open $ TMPDIR
2. Press Return (Enter) and a new Finder window will open with $ TMPDIR.
The $ TMPDIR files are not SIP protected, so be careful when handling them. In the folder you will find various temporary files and cache. As a reminder, you can only delete or edit something in this folder if you know exactly what you are doing.
You can also change the current folder to the temporary folder with a command like this:
cd $ TMPDIR
Other folders with temporary files MacOS
There is one more folder Mac OS with temporary files:
The / tmp folder in Mac OS contains links to / private / tmp /, i.e. it will contain the same data.
There are other folders with temporary files, for example, user ~ / Library / Caches /. In addition, some programs have their own folders with temporary files. Among them are Outlook and Mac App Store.
The main folder with temporary files is located at the following address:
~ / Library / Caches / TemporaryItems /
We remind you once again that you should not interact with temporary files without reason, as this can lead to unpleasant consequences. To clear temporary files, simply restart your Mac.