Find temporary files in OS X

from: http://superuser.com/questions/26714/cleaning-up-temp-files-in-mac-os-x

When a backup volume is not mounted, Time Machine has saved hourly snapshots to /Volumes/MobileBackups/ on laptops since 10.7. 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. 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. 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. 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. You can show hidden files with defaults write com.apple.finder AppleShowAllFiles -bool true; killall Finder.

Leave a comment