26

I was running OmniDiskSweeper today, and I came across something called "Private" using 3.9GB. It is listed directly under the root directory along with Users, Library, System, and Applications, so I am assuming it is something included with OS X itself. I'm just curious about what this actually is, because I don't remember seeing this before. Here are some screenshots:

enter image description here

enter image description here

enter image description here

Mid 2012 15 inch MacBook Pro running OS X 10.11.3 El Capitan

CSstudent
  • 1,081
  • Have you tried googling some of the file names? the more unique the more chance of finding the cause. – MrU Feb 17 '16 at 09:34
  • @Mark I believe your proposed duplicate is more of a /private/tmp-related question, but ComputerScienceStudent's question here asks more of "what is /private for". – perhapsmaybeharry Feb 17 '16 at 11:32
  • @Mark, "What's the “Private” directory in OS X for?" and "Why is /tmp a symlink to /private/tmp?" are not duplicate questions, not even possible duplicates IMPO. – user3439894 Feb 17 '16 at 11:35
  • The answer in the duplicate is an answer here - it could be expanded a bit but it is still the same answer – mmmmmm Feb 17 '16 at 11:37
  • Not a duplicate. See the answer below. @Mark – CSstudent Feb 17 '16 at 12:33
  • I'm leaving this closed. OP - could you remove the imaged and restate what you don't get? Since you've already received and accepted an answer - keeping this closed to new answers is good for the site since it now points to the main discussion on what /private is and does. – bmike Feb 17 '16 at 17:20
  • @MrU I came here because this one of the tops hist on Google for this folder. – Stuart Woodward Dec 18 '18 at 08:21

1 Answers1

17

/private has been around for a loooooong time. Every Mac has it.

It is part of your Mac: the directory stores essential system files and caches, along with other databases that your system requires to operate.


I'll give a quick explanation contents of the folders /private/etc, /private/tmp, and /private/var, usually found in /private:

/private/etc

Data files for system use, configurations for various command line tools etc

/private/tmp

System logs, mostly

/private/var

More logs, databases for daemons, virtual memory swap file(s), sleep image etc.


In essence, deleting anything in this directory is probably not a good idea, save for a few files. If you do delete them however, some required essential files will get regenerated on startup.

It's probably a good idea to Google the exact full directory path of any system folders you intend to tinker with before actually beginning to experiment with stuff inside.

I hope this helps.

  • My app needs to store a file not accessible/readable by a regular user. Would /private/etc/myfile be a good place to store it? – OrangePot Dec 04 '17 at 20:31
  • @OrangePot I believe that /private is generally reserved for system use and probably shouldn't be used for concealing files from the user. You'd also need root access to write to /private. I'd recommend storing your files in /tmp, with root being the owner and permissions as 700 or rwx------ (only root can r/w/x) – perhapsmaybeharry Dec 05 '17 at 03:14
  • What came into their mind? Things that are in /private actually belong in /usr/local, they don't? Well, I guess there is no turning back. – Martin Braun Oct 06 '22 at 18:33
  • There's nothing incorrect about this answer, but IMO it does not address the actual question. Traditional Unix/Linux/BSD systems have actual directories at /var, /etc, and /tmp -- but on macOS these are just symlinks to equivalent directories inside /private. Your answer nicely explains what's in there and why that data exists, but it does not explain what /private itself is for or why it exists. The reader is left wondering: What is the value of diverging from the norm? – JakeRobb Nov 02 '23 at 17:06
  • I found the answer here -- in the NeXTSTEP days, it was a way to store those directories locally in a netboot scenario. – JakeRobb Nov 02 '23 at 17:12