How to Remove Temporary Items & Bloated /private/var/folders/ in Mac OS X the Safe Way

Jan 13, 2016 - 20 Comments

Temporary cache folders and system var private folders in OS X

Mac OS creates various system level folders of temporary items and caches, which typically remain hidden from the average OS X user. Nonetheless, Mac users using various disk management utilities and apps like OmniDiskSweeper will come across these various temporary item folders in OS X, often at locations like /tmp and /private/var/ and /var/folder. Sometimes the items in these directories can be huge and take up dramatic amounts of disk space, which leads many Mac users wondering if they can safely delete the contents of the various /private/ folders.


For example on this particular Mac which is rarely rebooted, OmniDiskSweeper has discovered some large files hanging around buried deep in one of these temporary system folders of /private/var/folders/ further buried in /g7/7p9s/T/TemporaryItems/, with those many temporary items eating up a grand total of 44GB of disk space, hardly a soft footprint:

Huge temporary items folder in Mac OS X shown in /private/var/folders/

You want those files removed so you can regain that disk space, obviously. What should you do? Should you delete the files yourself? Is it possible to clear them out? The answer to this is both NO and YES, NO you should never clear those temporary cache items yourself, but YES you can have Mac OS clear out the temporary files itself. This may sound confusing but it’s really not, and getting Mac OS X to clean house and ditch those potentially enormous files is really simple.

NO, you should never manually delete items in the system temporary folders

The /tmp, /private, /var, /var/folder directories should never be manually adjusted, modified, or otherwise changed by the user in anyway. There are rare exceptions to this with very specific circumstances for advanced users who backup, but for 99% of the cases, no user involvement should happen in these system level temporary directories. No, do not go into those folders and delete files even if they are large, you should should never manually intervene in these directories. Doing so may damage your Mac OS installation and may prevent OS X from booting or behaving as expected.

OK so what if you have 40GB of temporary garbage stored in these folders, you want to remove that data obviously, how should you get OS X to ditch the temporary files it is holding onto? Can you remove the temporary data another way?

YES, you can clear out those temporary folders by letting OS X perform regular functionality

Yes, you can get those temporary /private and /tmp folders to clear their contents by allowing OS X to run through it’s own typical maintenance routine.

Do not manually delete items in /private/var/ or /var/folders, you could break something or cause a problem with OS X.

So what’s the trick to delete these files and have Mac OS clean house on it’s own?

How to Safely Clear Temporary Items & /private/var/folders/ in Mac OS X

The solution to remove temporary items in OS X is remarkably simple: reboot the Mac.

Simply rebooting the computer is usually enough to clear out the entire bloated temporary section of Mac OS system files.

By rebooting the Mac, you will trigger the built-in cache clearing functions of OS X upon boot and the unnecessary contents, caches, and temporary items in /private/, /var/, and /var/folders/ will delete themselves as deemed necessary by the Mac. This allows the OS to sort through the temporary files and caches and determine what is needed and what is not, which will clear out the vast majority of the stuff that has built up in there, particularly if the Mac hasn’t been rebooted in a long time, if you’ve uninstalled a ton of apps recently, or have performed a variety of other system actions.

If for some reason you reboot the Mac and the temporary files and tmp folders are still bloated with who knows what, you can reboot into Safe Mode by rebooting the Mac and holding down the Shift key, this performs additional measurements to get rid of temporary files and caches, when the Mac has finished booting into Safe Mode, rebooting back as usual should get things in check as expected.

And if you came across these folders because you’re running out of storage, check out some tips to free up disk space on the Mac, or do a file size based search, you’ll likely find something appropriate for recovering some space for your situation.

Enjoy this tip? Subscribe to the OSXDaily newsletter to get more of our great Apple tips, tricks, and important news delivered to your inbox! Enter your email address below:

Related articles:

Posted by: Paul Horowitz in Mac OS X, Tips & Tricks, Troubleshooting

20 Comments

» Comments RSS Feed

  1. Wharf Xanadu says:

    Regular reporting rebooting is. Good idea in general. Typing on this Poole. Is a side pleasure!!!! Hate typing on iPhone with a passion bbnbb??!!!

    Reboot t all

  2. Mike says:

    This could have been done in half the length. Why did I have to read that long repetitive introduction? By the way, the possessive “its” doesn’t have an apostrophe.

    • Todd says:

      Cool story Mike, you’re a great guy with great comments and great stories, I’m sure you’re full of great advice too. You know everything and you’re a genius. I can’t wait to read your website Mike!

      Sign me up for your Apple Newsletter Mike, you know it all and I am ready to absorb your knowledge. I am available at ToddMakowski @ yahoo .com

  3. islandmac says:

    Bad title, bad choice for OSX daily as a subject…

    • Curlie says:

      Is the title over your head? If you don’t know what temporary folders are in OS X, just reboot your Mac. Don’t overthink it bro.

  4. Chris says:

    Good information, thanks for the article. Some strange comments, though.

  5. Alberto says:

    Pasar ONYX ….. y solución

  6. Pauline says:

    One difficulty we experience, under the OS El Capitan™ lays in
    its way of removing serial numbers from software. Prior had
    purchased a right to use software. Now were forced to write
    and to ask please could we get serial numbers for software
    which had been working under a former OS.

    OS are recognized names from Apple™ a well known name.
    Not our trademarks

  7. Boise Ed says:

    And what ever happened with Applejack, which was a great way to clean up various aspects of the Mac?

    • UglyStuff says:

      AppleJack is a great utility, with two major caveats for the average user:

      1) It’s not fully compatible with Lion and above: it does work on them, but doesn’t perform all the tasks it was engineered for as it does in Snow Leopard, the last officially supported OS X version; and

      2) It only works in Single User mode, which many OS X users don’t even know exists, and couldn’t start on if their lives depended on it…

      Aside from that, AppleJack is a fantastic program, and I use it every once in a while when I feel my Mac becoming a little sluggish.

  8. Wharf Xanadu says:

    Some of you commenters should stick with iPad. This is way over your head.

  9. David says:

    Why do you brain boxes use this forum to sneer and witch at each other, wasting time, space and air when there are interested parties like little me with a keen thirst to gain knowledge who would welcome your genuine help?
    Your arrogance only shows your indifference, and is a measure of to which depth your heads are rectally positioned.

    🙂

    • Jason says:

      You win this thread. It’s a lot like the /r/apple subreddits. Full of snide know-it-all hipster d-bags that unleash hell on anyone who asks questions or doesn’t follow their precise way of computing.

      Sigh…

  10. System7Forever says:

    I use Onyx to do tasks like this. It is a very well-done and comprehensive maintenance program…been using it for at least ten years now, on every iteration of OS X that has come. It performs these “tune-up” sorts of of tasks flawlessly and efficiently.

    I run it once every couple of weeks, along with a permissions repair via DiskUtility after, as “preventative maintenance”. My MBP stays trouble-free.

  11. Fede says:

    I had 8 GB free now I have 40 GB thanks to arestart in SAFE MODE !! THANKSSSSSSSS

  12. Matias Burni says:

    check this… http://www.magnusviri.com/OS_X_Admin/what-is-var-folders.html
    You can redirect it to another partition modifying the following env_vars

    getconf DARWIN_USER_CACHE_DIR
    /var/folders/zz/zyxvpxvq6csvxfm_n000jt7w004fjz/C/

    getconf DARWIN_USER_TEMP_DIR
    /var/folders/zz/zyxvpxvq6csvxfm_n000jt7w004fjz/T/
    The temp dir can also be found by echoing the TMPDIR variable.

    echo $TMPDIR
    /var/folders/zz/zyxvpxvq6csvxfm_n000jt7w004fjz/T/

  13. Andrea says:

    Thank you so much for yr help. I had no idea on what to do…. And for all the other idiots who have nothing positive to say, if you are all such apple geniuses why were you even on this site if you know it all. This is to help people who need it. Not somewhere you complain like teenagers to inflate your obviously already deflated egos, and have a go at someone who’s helping….
    Grow up…. Seriously get a life!!

Leave a Reply

 

Shop for Apple & Mac Deals on Amazon.com

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates