I see that it takes ~4G space
I have MacBook Air and wanted to check if it is safe to delete the folder
3 Answers
No, it is not safe to delete the contents of this folder. Among other things, the /private/var/db/dslocal folder contains the database of users and groups on your computer, so deleting this would leave you unable to log in (and probably make the computer unable to boot). Some specific subfolders of /private/var may be safe to empty, but many will simply be recreated. See, for example, the question about /private/var/vm that ben linked.
It is not safe to delete it, as /private/var can be used by several applications and services.
Some of the files can be deleted only after stopping certain services/daemons or after rebooting your Mac.
Therefore you should check the content of it and find the folders which are used the most, and decide separately.
For example:
- for
/private/var/db/systemstats, check: What is the use of snapshot.db? - for
/private/var/folders, see: It is safe delete OSX's /private/var/folders/* at reboot? - for
/private/var/vmsee: Can I delete /private/var/vm? - etc.
yes - it is safe. My clean-up scrip uses:
sudo rm -rf /private/var/folders/*
You'll have no issues after deleting the contents of var/folders - except maybe a faster machine
1