What is /private/var/folders on Mac? Can you delete it?
Do not delete /private/var/folders or its contents by hand. macOS and running apps keep temporary files and caches there, and removing them while they are in use can cause crashes and odd behaviour. Restart your Mac and macOS clears what it safely can.
Where it is
/private/var/foldersWhat it is
macOS gives every user account, including hidden system accounts, a private area under /private/var/folders. The folder names are random-looking strings. Inside each one, a folder called T holds temporary files and a folder called C holds caches.
Your own temporary folder is the one the TMPDIR variable points to in Terminal. Apps use it for scratch files, unpacked downloads, compiler output and similar short-lived data.
It grows when apps leave temporary files behind, usually after a crash or a long session. macOS removes temporary items that have not been used for a few days and tidies more at startup.
How big it gets
Usually from a few hundred MB to a few GB. A much larger figure normally points to one app that is leaving temporary files behind.
How to shrink it the right way
- Run the command below to see how much space your own cache and temporary folders take. It only reads sizes.
- Quit your apps and restart the Mac. This lets macOS clear temporary files that nothing is using any more.
- If the folder is still very large, look inside your temporary folder with open $TMPDIR to see which app the big items belong to, then clear that app's cache from its own settings or update the app.
- Do not use sudo to remove folders here, and leave the folders that belong to other accounts alone.
du -sh "$(getconf DARWIN_USER_CACHE_DIR)" "$TMPDIR" 2>/dev/nullWhat happens afterwards
After a restart, apps recreate the temporary files and caches they need, so some of the space is used again. Nothing of yours is stored here permanently.
How Diskzy handles it
Diskzy's System Data view breaks macOS's System Data into named parts, each sized and marked Safe to clear, Look first or Managed by macOS, so you can see where space like this sits.
Related guides
- Caches~/Library/Caches
- sleepimage/private/var/vm/sleepimage
- swapfile/private/var/vm/swapfile0
- Logs~/Library/Logs
See where your Mac's space went
Diskzy maps your disk, explains System Data and clears what's safe. Free for 72 hours, then $9 once for 2 Macs.
Try Diskzy for free