MacOS is complicated and has a nested folder structure. When the application is installed, you might come across various unfamiliar directories on your OS. Most of the users don’t bother touching these kinds of files.
As there are not for regular users, Apple makes sure that those specific folders stay hidden. The repercussions of mishandling these files could be the loss of data, mac not functioning properly or not working at all. Downright scary?
In this post, we have mentioned such places or locations on your macOS file system, which you shouldn’t touch.
Hidden /private/var Folder
When a computer runs and is operated, a lot of user and system cache files are generated to speed up the computer. The user caches and temporary files are located in /Library/Caches and you can delete them from this location to recover space on your system when needed.
However, the system cache files are managed by macOS, that’s why they are hidden and shouldn’t be messed around with. If you are sure and want to recover invaluable space on Mac by deleting the files on it, you can check this out.
How To Locate /private/var/folders?
The easiest way to locate the /private/var folder is through Finder’s Go to Folder context menu.
- To access it, press Cmd + Shift + G together to get Go to Folder box and type /private/var/folders, hit enter.
- A new Finder tab will open.
- To get the location of system cache and temp files, hit spotlight icon and type Terminal to get Terminal window.
- Now on Terminal window, type this: open $TMPDIR
- You will get a folder whose name would start from two characters with long, random subfolders. Look for three folders, C folder(cache), T folder (temporary) and 0 folder with User files.
Problems With /private/var/folders
If your /private/var directories are taking more space than needed, then it requires your attention. However, you shouldn’t try to handle things on your own, as it could corrupt document data, the core files or hinder the process of booting of Mac as we speak.
Then, you wouldn’t have any option but to reinstall macOS.
If you want to eliminate the files without damaging macOS, then navigate to Apple Menu and select Shut Down. As rebooting your Mac, you activate the inbuilt cache clearing process. The unwanted content, caches and temp files are removed from /tmp, /private/var/folders and /private/var.
Important Folders in /private/var
There are some folders which you shouldn’t touch and make changes to:
- /private/var/db: The folder has a couple of macOS data and configuration files. It has network configuration files, Spotlight database and more.
- /private/var/VM: This folder has sleep and swap image files. If you let your Mac sleep, this directory will use more than 5GB of disk space.
- /private/var/tmp: Temporary file directory.
Language Files and Folders
The application on Mac comes with language files for each language they support. That’s why when you switch your system language, the language on all the app will change concurrently.
To locate the language files of an app, right click on it and select Show Package Contents from the menu. The path will be:
If you wish to remove language files from third-party apps, you can use Terminal. However, if you wish to do the same to the native apps of Mac, it is mandatory to disable System Integrity Protection (which is quite risky and not recommended).
No matter, how many troubleshooting steps ask you to delete language package of an app to retrieve space, it involves risk. As when you remove these files, you can’t possibly think whether the app will freeze or crash. The app might also stop working altogether, and you might have to reinstall it. Some of the apps such as MS Office wouldn’t work after the update. That’s why don’t touch Language folders.
System Library Folder
There are a lot of Library folders. There are a lot of similarities between the contents of the Library folders, every folder has a different role to play in mac operating system ’s filesystem.
There are three Library folders:
The /Library and System Library folders have a global scope. The elements on it support every feature of the system. The System Library folder consists of the files required to operate macOS. The data on it could only be modified by OS and the system level events should have an effect on it. That’s why there is no reason to touch this folder.
Hidden Folders in the Home Folder
There is a reason why your operating system hides some files on the computer. You can press Shift, Command and Period together, you will get some folders on Home directory which appear to be hidden. Some macOS technologies and apps keep their data in hidden folders as they shouldn’t delete or make changes in the files or folders.
We have mentioned such files and folders:
- .Spotlight-V100: This folder has Spotlight metadata for every drive. The mdworker processes take help of this metadata to update Spotlight search.
- .fseventsd: .fseventsd is a log file of FSEvents recorded by fseventsd launchdaemon process. It detects file system events, for example, file creation, deletion, modification, and more. This file helps Time Machine to process backup in the background.
- .DocumentRevisions-V100: This is macOS versioning database which helps apps to save and recover various versions of a certain document.
- .PKInstallSandboxManager: The file is used for keeping software updates & sandboxing.
- .PKInstallSandboxManager-SystemSoftware: The folder keeps system software updates.
- .Trashes: Trash folder in every drive.
User Library Folder
The Library folder is your user account’s personal Library. macOS contains system, preferences, and third-party support files. It also has Safari bookmarks, Mail settings, calendar data, history and more. The Library folder has some of the folders which need to be cleared every now and then. But it is advised not to touch the folder.
Under Application Support, you will get the native apps and third-party apps store support files, generally a subfolder under the same name. They also have registration data and saved app data used in a specific period. It is advised not to delete contents of this folder.
Preferences have all the preference data for native and third-party apps. Also, it is advised not to delete the contents of the Preferences folder; as it could make it go in a default state or make it crash.
Mobile Documents is the location of the iCloud folder. It contains documents, application preference files, iOS app data, and other. It is advised not to move, rename, or delete anything on the folder. if you use iCloud, the folder acquires a significant amount of data. You can always delete the unwanted files from iCloud Drive to retrieve space on your computer.
Containers consists of cached data, support files and temporary files for apps that you got from App Store. As the apps on the App Store are sandboxed, the apps are not able to write data anywhere on the system. It is strictly advised not to delete contents of the folder. You can retrieve disk space by reinstalling a specific app.
Backup Is Important
Whenever you are working your way through any of these folders, it is recommended to take a backup as one wrong step is all it takes to corrupt data, apps and your macOS. The people who don’t meddle with these folders shouldn’t be concern about it. However, if you like peeking around, it is good to maintain a backup file which can come in handy in many ways. If you lose data, recover it easily by restoring the backup files.
Bottom line, you should not touch the aforementioned folders, however, if you decide to do it instead, then keep a backup of your data to make sure you don’t lose data.