Can I delete things safely from ~/Library?
I am running out of storage space on my 2011 MacBook Air. I was thinking I should clean up before I contemplate adding more storage.
I notice though, that while I have ~30 GB in ~/Documents, ~2 in ~/Movies, ~10 ~/Pictures, I also have ~70 GB in the ~/Library folder.
What can I safely delete (if anything), and what is the best method to delete from this folder?
Here is the result of the cd ~/Library; du -sm * | sort -rn | head -16
script:
46559 Developer
26874 Application Support
23941 Mail
4822 Containers
2030 MobileDevice
1524 Logs
1430 Caches
1371 iTunes
1032 Mobile Documents
229 Safari
65 Dragon Profile.ddictateprofile
40 Keychains
35 Preferences
33 Internet Plug-Ins
29 Mail Downloads
26 Autosave Information
Solution 1:
To see which folders inside ~/Library
use most of the space, run something like
cd ~/Library; du -sm * | sort -rn | head -16
in Terminal which gives you the 16 folders using the most space.
Specific cleanup actions afterwards depend on the folders found.
Solution 2:
This question is a bit old now, but I figured I'd add my experience for googling.
While developing BLE applications on 10.11.x versions of Mac OS, I often found that I had to clear BLE data from ~/Library in order to return to a pre-connected/paired state on server (not client) devices.
I began experimenting with ~/Library to reduce bloat on a system where HDD space was running low. Having planned on performing a fresh install anyway, I further experimented by rm
ing the entire ~/Library directory and rebooting. I didn't expect that the system would return to an operational state.
Upon boot I had to log back into iCloud, set up Slack, set preferences on keyboard, trackpad, terminal, browser, programs, etc..
The system survived and is still running great. After all settings were back in place, a df -h
showed that I reclaimed about 16GB.
I understand that this could be a hugely risky move depending on what applications are installed and your level of comfort with losing data/time. In my case the user account was not valued and the machine was pending complete format. However, with it being a somewhat loaded dev machine, I was surprised to find that the system was surprisingly tolerant of the complete removal of ~/Library.
Solution 3:
I had a huge (300gb+) ~Library. The culprit was Steam games that were living in /Users/_myusername_/Library/Application Support/Steam/steamapps/common
.
To figure out what games were taking up the most space and remove them:
- I jumped into my library:
cd ~/Library/"Application Support"/Steam/steamapps/common
- Figured out the biggest files:
du -sm * | sort -rn | head -16
- Opened the Steam application and deleted those games which then removed the files.
What a pain.