Clearing space on OS X

Deleting the crud and getting back a few gigabytes

This document is extremely outdated. I wrote it when I got the very first MacBook Air, which came with a paltry 64 GB flash drive. Storage space was at a premium and I wanted to get rid of uncecessary stuff. My much newer MacBook Air has 512 GB of storage and my desktop systems have over 16 TB of storage with even more network storage. Space isn't quite as tight.

1. What takes up space?

With a 64 GB drive on the first-edition MacBook Air, disk space no longer seems unlimited. These notes are in the context of an installation of OS X Leopard (10.5) on a MacBook Air. The top-level space hogs on a new, out-of-the-box system:

directory space comments
/usr 947 MB Unix commands (bin, sbin), X11
/Applications 2439 MB
/private 2497 MB mostly 2 GB for the sleep image
/System 4100 MB Frameworks, Speech, Fonts, Perl, Java, etc.
/Library 7117 MB Application Support, Printers, Audio, core Fonts, Dictionaries, Receipts, etc.

The biggest applications in an out-of-the-box system are:

application space
iChat 111 MB
iDVD 120 MB
iMovie 120 MB
iTunes 120 MB
iPhoto 169 MB
GarageBand 181 MB
Mail 287 MB
iWeb 338 MB

Biggest /System stuff:

application space
Library/Speech/Voices 703 MB
Library/Frameworks 1358 MB

The biggest /Library stuff:

directory space comments
/Library/Documentation 542 MB mostly help text
/Library/Application Support/iPhoto 407 MB
/Library/Application Support/iDVD 438 MB
/Library/Application Support/GarageBand 756 MB
/Library/Printers 3231 MB

You can go through the Printers directory and discard the manufacturers that you don't need (at the top level).

A clean user account takes up 15 MB, with caches taking up 14 of those megabytes. The Desktop cache takes 6 MB.

2. Removing languages

You don't really need Portuguese help text for a printer you never use, do you? It's time to remove all the extra languages from help files and applications. Download monolingual. Click on the downloaded dmg file and install the monolingual program into Applications (or Application/Utilities) by dragging the monolingual icon to the Applications icon.

Before running it, go to System Preferences > International > Languages > Edit List and uncheck the languages you don't need. This will probably be everything except for English (you don't need U.S. English).

Now run monolingual. It will take a long time. When done, it reports a space savings of 3.2 GB. Given that the initial space used was 17.48 GB, that's a savings of over 18%!

After monolingual cleaned up languages, you might want to go to the next tab and use it to remove input menus for Korean, Kotoeri, Simplified Chinese, Traditional Chinese, Tamil, and Vietnamese. That will save another 53 MB.

The final tab is architectures. Until recently, monolingual would remove critical PPC code the System Frameworks directory, disabling Rosetta. That's been fixed in the latest version of the software. Stripping out architectures saves around another 2 GB.

Let's look at our space offenders again:

directory before after
/usr 947 MB 947 MB
/Applications 2439 MB 670 MB
/private 2497 MB 2496 MB
/System 4100 MB 3227 MB
/Library 7117 MB 6090 MB

The biggest applications in an out-of-the-box system now are:

application before after
iChat 111 MB 15 MB
iDVD 120 MB 63 MB
iMovie 120 MB 76 MB
iTunes 120 MB 51 MB
iPhoto 169 MB 67 MB
GarageBand 181 MB 87 MB
Mail 287 MB 25 MB
iWeb 338 MB 128 MB

The biggest /System stuff is now:

application before after
Library/Speech/Voices 703 MB 703 MB
Library/Frameworks 1358 MB 1218 MB

The biggest /Library stuff is now:

directory before after
/Library/Documentation 542 MB 32 MB
/Library/Application Support/iPhoto 407 MB 387 MB
/Library/Application Support/iDVD 438 MB 433 MB
/Library/Application Support/GarageBand 756 MB 756 MB
/Library/Printers 3231 MB 2802 MB

We now use 13.86 GB instead of 17.48 GB.

A fresh install

Installing OS X from the DVD gives you the option of selecting optional components:

  • Printer drivers (2.2 GB)
  • Additional fonts (141 MB)
  • Language translations (1.8 GB)
  • X11 (117 MB)
  • Bundled apps (4.7 GB)

You probably don't need the additional fonts. These are just foreign-language fonts or foreign versions of existing fonts (such as Cyrillic or Hebrew versions of Helvetica). Even without installing these fonts, you still get a core set of foreign fonts.

If you expect to enter an environment where you'll want to configure a printer on the fly then you may want to install the printer drivers. Otherwise, you can do without them and just download the latest driver when you're setting up a printer.

Unless you plan on working with different languages, you don't need language translations.

You know if you need X11. If you're not sure then you don't need it.

Bundled apps is a judgement call. Pick what you need.

When all is done, the installer still installs several gigabytes of foreign-language support files! You'll need to run monolingual (or similar script) to remove them.

Removing Applications

Apple would like you to think that uninstalling an application is as simple as dragging it into the trash. That's sometimes true but it depends on how much crud the application placed in other locations and whether it cleans up after itself when you trash the application.

Your best bet is to use an uninstaller for an application if one was included on the installation media or was installed along with the application.

Failing that, you can use one of several programs that are designed to delete applications along with related files. A few of these are:

I haven't done a thorough comparison of these and have lately been using AppCleaner. Unfortunately, these programs tend to leave behind log files, caches, and support files. TrashMe seems to be the best of the bunch based on some reviews. An all-purpose app remover, universal binary cleaner, language remover, and cache cleaner is CleanMyMac but I have not used it. You can read a review of it here from SoftwareHow.

To do the job manually, check the following places:

/Applications
This is where the application lives. Applications are generally directories (application bundles, adapted from NeXT) that contain the executable, supporting libraries, associated images/text, plug-ins, and version information.
/Users/your_name/Library/Preferences
Personal application settings are stored here (for example, a list of cities you selected for the weather widget). Most applications just create a directory indexed by their domain name, such as com.Google.GoogleEarthPlus.plist. Others create a directory with the name of their application or their company or some such variant.
/Users/your_name/Library/Receipts
Applications generally place installation information here. Included are lists of files, pre-installation scripts, and post-installation scripts. If you look at the package contents, you will often find a file named Archive.bom, a "bill of materials" file. You can run the shell command:

lsbom Archive.bom
to see the contents and get an idea of what was installed where by the software. For example, by running

lsbom /Users/your_name/Library/Receipts/iDVD.pkg/Contents/Archive.bom
we can see that iDVD creates 6,229 files and directories in /Applications/iDVD.app. It also creates 51 files and directories in /Library/Documentation/Applications/iDVD. Most people advise against removing the receipts as they don't take up much space and give you the breadcrumbs to find stray files. If you really want to obliterate traces of an application, you might as well remove the receipt along with other files. Just do it last.
/Library/Receipts
Same as the per-user Receipts directory but for applications and components installed at the system level.
/Library/Application Support
This is analogous to the user Application Support directory but holds system-wide components, such as sample projects and themes.
/Library/Preferences/
This is analogous to the user Library/Preferences directory but holds system-wide preferences.
/Library/StartupItems
Contains a list of scripts run at system start-up.

Example: Removing GarageBand

If we look in /Library/Receipts, we find:

  • GarageBand.pkg
  • GarageBandFactoryContent.pkg
  • GarageBand_Instruments.pkg
  • GarageBand_Loops.pkg
  • GarageBand_MagicContent.pkg
We can list all the files and directories created by all these packages with:

cd /Library/Receipts lsbom GarageBand* >/tmp/g.txt
g.txt now contains a list of all the files and directories installed by GarageBand. The directories used solely by the program are:
  • /Applications/GarageBand.app
  • /Library/Audio/MIDI Drivers/EmagicUSBMIDIDriver.plugin
  • /Library/Documentation/Applications/GarageBand
  • /Library/QuickLook/GBQLGenerator.qlgenerator
  • /Library/Spotlight/GBSpotlightImporter.mdimporter
  • /Library/Application Support/GarageBand
  • /Library/Audio/Apple Loops

These will be reinstalled if the application gets reinstalled. Together, they consume 944 MB of disk space. While all of the listed directories could be removed, the biggest offenders are:

  • /Applications/GarageBand.app (87 MB)
  • /Library/Application Support/GarageBand (756 MB)
  • /Library/Audio/Apple Loops (96 MB)

Example: Removing Printer Drivers

Navigate to /Library/Printers. You'll see a list of brands. If, for example, you don't plan on using Canon printers, move Canon to the trash (Canon drivers consume 460 MB).