Written byJenny Zeng
How to Access & Delete Files from private/var Folder on Mac?
Summary: Where is private/var/folders? This post discusses the /private/var folder on Mac, how to access it, and how to delete space-hungry files in subfolders like private/var/folders.
If you use disk management tools like iBoysoft Diskgeeker to scan your hard drive, you may find the /private/var folder on Mac takes up gigabytes of disk space. Naturally, you will wonder what data the folder stores and whether they can be safely deleted to free up space on Macintosh HD. Read on to find the answers.
Guide to /private/var folder on Mac:
- 1. What is /private/var folder on Mac?
- 2. How to access /private/var folder on Mac?
- 3. How to delete files or folders from the /private/var folder on Mac?
What is /private/var folder on Mac?
macOS creates several folders of caches and temporary items to speed up the system. Those under your control are located in /Library/Caches and /private/tmp. But system-related cache files are hidden in the /private/var folder on Mac. Here are some of the commonly requested subfolders of the /private/var folder on Mac:
Inside macOS private/var/folders are randomly named cache files and temporary data. When you open its subfolders like private/var/folders/zz and dive deep into the folder, you will often see these four folders: 0, C, T, and Cleanup At Startup. The 0 folder represents user files, C is for caches and T is for temporary files.
The private/var/root folder is one of the /private/var folders on Mac that has a red circle with a minus sign at the lower-right of the folder. The symbol signifies that the system owns the files inside, and you don't have permission to see the contents. You should not modify or delete the folder as these files are essential to the operating system.
The private/var/db folder resides macOS configuration and data files, such as Spotlight database, system policy files, Battery data, network configuration files, etc. You can find the local directory data in the private/var/db/dslocal folder, which contains accounts for Users and Groups. The receipts for packages and apps installed on your Mac can be found in /private/var/db/receipts.
The private/var/vm folder includes swap and sleep image files. In my case, the folder has only one sleep image of 1.07GB. If you hibernate your Mac, this folder will occupy more disk space.
How to access /private/var folder on Mac?
You can follow the steps below to access the/private/var folder on Mac:
- Open Finder.
- Click Go > Go to Folders from the top menu bar.
- Input /private/var and hit Enter.
Since there are likely hidden files in one of the folders, especially the private/var/db folder, you can press Command + Shift + . to unhide these files. Press the same keyboard combination when you are ready to hide them again.
If you want to view folders in a red circle with a minus sign, you need to change the permission with the steps below manually:
- Right-click on a file or folder and select Get Info.
- Tap on the lock and enter your password.
- Under "Sharing & Permission," locate Me or Everyone.
- Change from "No Access" to "Read & Write."
- Lock the padlock to save changes.
Alternatively, you can run the Terminal command below to check files in a folder. (e.g. check files in private/var/root)sudo ls -a /private/var/root/
How to delete files or folders from the /private/var folder on Mac?
Some users may find files in a certain /private/var subfolders take up an abnormal amount of space. Upon which, the first instinct is to remove the files from your Mac. But can you delete files from the /private/var folder?
Although some forum users suggest that you can delete everything within the subfolders like /private/var/folders but not the folder itself, other information insists that you shouldn't mess with the /private/var folder.
From what we have read, you shouldn't delete items in the /private/var folder unless your Mac urgently needs the space they took and other feasible solutions failed to free it. That's because macOS may not recreate the files you deleted, although it regenerates many files it needs after the system and related application restarts.
When you have found huge files in the /private/var folder, you should first try closing all apps and restarting your Mac, which usually removes temporary items and caches from /tmp, /private/var, and private/var/folders. A reboot is particularly helpful if you haven't restarted your Mac for a while, have recently uninstalled many apps, or have executed various other system actions.
If a reboot doesn't free up the space, you can boot into Safe Mode by holding the Shift key while restarting, then click Restart to reboot back as usual. Safe Mode can repair directory errors and remove cache files of all types. If the issue persists, locate the specific file or files that are eating up the space and google them for more information.
If it occurs to you that deleting the file is your last straw, make sure to close all running apps and back up the file you want to delete to a different location first in case of side effects.