How to Clean Your Mac in 10 Minutes Without Installing or Paying for Third Party Apps
Disclosure: This writing is a result of my own findings. It also assumes basic command-line knowledge. Use at your own risk. Last updated: 01/2017
See What is Taking Up Space
If your breakdown is dominated by media files, you can comb through your personal videos and pictures and back up/delete them as necessary. Most likely, the “Other” Category will be the largest consumer of your available disk space. OSX lumps files, caches, hidden files, and system files all under “Other”. If you have enormous personal projects or media archives, then you should take care of that yourself (and you probably wouldn’t be here right now). This guide is on cleaning up system or hidden files that most users typically ignore or aren’t aware of.
How to Clean ‘Other’ Files
To see what files are eating up most of your space, you’ll need to scan your disk.
> brew install coreutils
(If you don’t have Homebrew it’s highly recommended, but if you really don’t want to install it, you can change the command below to
sort -n though it will make your life slightly harder).
Run this command:
(for d in *; do; du -hs $d; done) | gsort -h
This will recursively go through all the files and folders in your current directory and aggregate a list of their sizes. This is essentially what all third party apps do when they scan your disk. Because it parses your entire directory tree, running this in your root directory may take a long time. I’ve found it’s more useful to run it in places I know take up a lot of space but want the breakdown for (
The worst thing you can do is to be slightly too trigger-happy with
rm -rf and spend the rest of the night mulling over your bad life decisions.
The (generally) largest but safer things to remove are
Library files. There are 3 types of Libraries:
~/Library. Very broadly,
/Library is accessible by everyone,
/System/Library is used by the system, and
~/Library is used by the user. There are a lot of repetition and unneeded files here and between all of them you can probably clear up 10G depending on how long ago you last cleaned your Mac.
Fonts take up a large amount of space and let’s be real - you probably don’t even use most of them. Specifically, I had foreign language fonts that I’ve never used. If you don’t type Japanese or Chinese, feel free to remove those.
Macs keep old updates for some reason. I’ve checked and they’re either old or incomplete updates. They have names like
031-63459. I deleted them without consequence, but maybe you should check the contents of yours.
This is more for developers, but compilers take up a huge amount of space. I haven’t touched Java since college. Gone.
Mac has high res pictures for your screen saver, desktop, user pictures. It’s not that big a deal, but altogether they take a couple gigs. If you don’t use the default images, this is a safe one to delete.
OSX has a ton of dictionaries and you guessed it: (depending on your job) you probably don’t use most of them. Plus Google is a click away. I deleted all the dictionaries that were not English (Dutch, Spanish, French, Japanese, Chinese). There are two Oxford Dictionaries on my computer for some reason. I kept them both just in case I desperately need the New American version over the English version.
iTunes saves a lot of junk so you can sift within the folder to find exactly you no longer need. You should clean old iPhone backups as well. I don’t personally use iTunes so can’t help much here.
You can do the same thing with your
/System/Library if you still need room. Generally I don’t like to mess with system files so if you do, just don’t delete anything that affect core services.
Cached files are the major recurring factor for what will eat up your space. Application Support is the next closest if you install and heavily use applications between clean sessions. Your caches live in
~/Library/Caches/ and you will want to go in there and clean out some stuff. My Mac is kind of small, so I set a monthly cron job to clean this up. Each application has its own set of caches, but in general, they are pretty safe to delete, especially if you are desperate for space.
Cleaning Up Unneeded Apps
Apps take up an enormous amount of space but oftentimes, this is inevitable. If you want to use Chrome and Spotify, you have to put up with the space it takes up on your computer. However, you can clean out apps you don’t use or ones that come with your Mac. Contrary to some popular belief online, you can delete Mac native apps (eg iMovie, GarageBand), but you will need
root access to do it. If you run the above command in the
/Applications directory, you can see which apps hog the most space and
sudo rm -rf the ones you do not use.
Your job is not done yet! Once you clean out your junk apps, you need to delete its Supporting Files, User Data, and Logs. These are the files that the app uses on startup, but live elsewhere on your filesystem. Your app may have none, some, or all of the following.
First, go to
~/Library/Application\ Support/ and delete the corresponding directory for your app. The Application State can be found in
~/Library/Saved\ Application\ State and usually is formatted
com.[company].[product].savedState. Most likely you have a few of these, so go ahead and clean those up. Logs are located in
find and delete your app’s logs. Finally, if you missed it earlier, make sure you delete the existing cache for your apps.
If cleaning your Mac was not enjoyable and fulfilling for you, you can consider one of a ton of disk cleaning apps. Otherwise, invest in an external hard drive where you can dump your things and not keep your files on your internal hard drive. There are also cloud-based options such as iCloud, Dropbox, and Google Drive, which offers the obvious convenience of being able to access all your things without your computer, but charge recurring fees. It’s really a personal preference.
If I missed anything in my haste, please let me know! Hope this was helpful to at least someone out there.