Skip to content

Instantly share code, notes, and snippets.

@fintanr
Last active September 24, 2016 09:54
Show Gist options
  • Select an option

  • Save fintanr/d8087a1487ccdfa91b17 to your computer and use it in GitHub Desktop.

Select an option

Save fintanr/d8087a1487ccdfa91b17 to your computer and use it in GitHub Desktop.
Lack of disk space on Mac - check out whats happening in /private/var/folders
TL; DR - running out of disk space on your Mac, try a safe reboot to
properly clear /var/folders.
I noticed I was just about out of disk space on my Mac earlier, and digging
around noticed that /var/folders was huge.
cd /var/folders; sudo du -shc
125G .
125G total
I suspected com.apple.IconServices among others
sudo find /var/folders -name com.apple.IconServices -exec du -shc {} +
636M /var/folders/05/x288dhqn2ksbc05r61ymthzw0000gq/C/com.apple.IconServices
642M /var/folders/0f/0lr8_ls52qd8ggm3nm5ktwfr0000gq/C/com.apple.IconServices
636M /var/folders/0l/2l_yh0tx3j9_f08_82rfd4mh0000gq/C/com.apple.IconServices
....
642M /var/folders/zx/709fdx3x2zj6wmc19w4cxgqr0000gq/C/com.apple.IconServices
120K /var/folders/zz/zyxvpxvq6csfxvn_n00000bh00002w/C/com.apple.IconServices
84G total
The easiest (and safest) way to clear /var/folders is to do a safe reboot.
Power off your mac, power back on, hold down shift once you hear the startup
beep and a progress bar will appear. Grab a coffee, let MacOS do its thing and
then reboot back to normal mode.
$ cd /var/folders; sudo du -shc
836M .
836M total
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment