Macos – cleaning up temp files in mac os x – super user

My 4 months old Mac partition volume is losing space slowly and gradually. Calories apple fritter I am pretty sure there are a lot of orphaned temporary files laying around in the volume.

I know where to find the obsoleted temp files in my Windows partition, how about in Mac OS X?

Mac OS X temporary files are stored in /tmp and /private/var/folders. Calories in 1 2 apple Your specific Cache and Temporary folders can be found by running the command echo $TMPDIR and/or usr/bin/getconf DARWIN_USER_CACHE_DIR

These locations should be automatically cleared out regularly either through the daily, weekly and monthly “cron” scripts and/or a restart so you shouldn’t have to worry about it. Calories in 1 apple You can use tools such as Onyx, Cocktail, Leopard Cache Cleaner, etc. Calories in 1 green apple to run these scripts and/or clear your caches and temp files.


The one big exception is Safari’s Thumbnail cache does not delete and can be found in your DARWIN_USER_CACHE_DIR under com.apple.Safari.

To find out where most of your disk space is going (and if temporary files are even a culprit) I suggest using a program such as OmniDiskSweeper or GrandPerspective to tell you where all the large files are.

Another couple of possible set of options for checking what is occupying disk space:

Baseline — unique among disk scanners in that it has a brilliant snapshot function. Calories in a granny smith apple So it scans your disk and shows you what is occupying space, but it will save this snapshot. Calories in a green apple A couple of weeks later, run it again and compare to your last snapshot – it will tell you every file that has changed. Calories in a small apple This is unique and very very useful, especially before/after installing large software suites.

Daisy Disk — This is visually the most beautiful of the OS X disk scanners, I always prefer the pie maps visualisation…

When a backup volume is not mounted, Time Machine has saved hourly snapshots to /Volumes/MobileBackups/ on laptops since 10.7. Calories in an apple They are deleted automatically when you start running out of disk space though.

/private/var/folders/ can contain partially downloaded files or files for applications that have been removed. Calories in an apple fritter du -sm /private/var/folders/*/*/*/*/ | sort -rn sorts the folders by size.

~/Library/Autosave Information/ can contain old unsaved documents.

~/Library/Caches/com.apple.Safari/Webpage Previews/ was about 700 GB on my installation of 10.7. Calories in apple butter defaults write com.apple.Safari DebugSnapshotsUpdatePolicy -int 2 disables saving the thumbnails.

Safari saves the contents of websites and plain text files to ~/Library/Caches/Metadata/Safari/History/.

If hibernatemode is 3, /var/vm/sleepimage takes up the same amount of disk space as the amount of RAM you have.

/Library/Developer/ wasn’t removed when I installed Xcode 4.3. Calories in apple cider vinegar It contained about 2GB of old docset files.

A good way to find large files is to sort files by size in list view after checking calculate all sizes in the view options. Calories in apple juice You can show hidden files with defaults write com.apple.finder AppleShowAllFiles -bool true; killall Finder.

Most of what I could say is covered above, with a couple exceptions that may or may not apply to your specific case:

If you use Adobe Bridge, the cache folder can get quite amazingly big. Calories in apple pie I cleaned mine out the other day and ended up removing 8gb of extra space. Calories in apple pie slice Also I’m using CS4, and I noticed that my CS3 cache folder was still around even though I got rid of CS3 a while ago. Calories in applesauce Another 2+ gigs there.

I also use Parallels 4 and it has a nasty tendency to use up all of the free space given enough time, but a computer reboot handles that. Calories in green apple This could be just me though. Calories in medium apple If you do have Parallels or Fusion and have regular snapshots made, that could also be a factor.

I use Whatsize to check what’s taking up space, but I got my copy before they started charging. Calories in one apple I like it better than the other ones I’ve seen.

Reboot your computer. Calories in one large apple If it suddenly has lots more free space, this is due to the ever-expanding swap files. Calories in red apple They are reclaimed (deleted) upon reboot and will eventually get re-created as you use your Mac. Calories in red delicious apple This is completely normal.

There’s no need for their existence to turn you into a reboot-obsessed user, however. Calories in red delicious apple large It’s a good thing when your Mac swaps unused memory out to disk.

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you’re looking for? Browse other questions tagged macos mac hard-drive performance or ask your own question.

Leave a Reply

Your email address will not be published. Required fields are marked *