How to use Terminal to speed up Mountain Lion

Karl Hodge
31 August, 2012
View more articles fromthe author

If you’ve tried everything else and still want to make your Mac run faster, roll up your sleeves, crack your knuckles and prepare to take on a challenge. The Terminal is your direct portal to OS X’s kernel. There are no menus or tick boxes to negotiate here. We’re back to old-school computing, setting up configuration options at the command prompt. Scary? Not really.

In many cases you can access features you won’t find anywhere else in the system. In others, it’s faster to tap out a quick command than negotiate your way through obscure control panels, menus and dialogue boxes.

If you’ve never used the Terminal before, you’ll find it in the Utilities folder in Applications. It’s easier still to find in Launchpad, in the Utilities group. Once you open it, you’ll be faced with a blinking cursor, a blank window and a lot of possibilities. It’s time to tune up your Mac.

Step 1: Turn off the Dashboard

Did you know that Dashboard widgets uses CPU cycles even when they’re not active? To switch off Dashboard widgets – you can switch off the entire Dashboard. Type the command:

defaults write mcx-disabled -boolean YES

killall Dock

Hit return to make the magic happen.

 Step 2: Bring it back

If you find that you’re really missing the calculator or that widget that tells you what the weather’s doing, you can bring back the Dashboard, at the Terminal. Use the command:

defaults write mcx-disabled -boolean NO 

killall Dock

The ‘killall’ command at the end resets the Dock, by the way.

Step 3: 2D Dock

If you’re determined to squeeze every nanosecond of speed out of your Mac, you can sacrifice some of Mountain Lion’s dashing good looks. Reverting to the old style 2D Dock will shave off a sliver or two of time. Use the command:

defaults write no-glass -boolean YES

killall Dock

Step 4: Disable automatic window animations

It takes a fraction of a tick for windows to animate when you open and close them. A portion of a second you can claw back with the following Terminal command:

defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool NO

Replacing ‘NO’ with ‘YES’ will bring your animations back. If you’re using an application, you may need to relaunch it to see the (lack of) effect.

Step 5: Rebuild your Font Cache

If you install and delete lots of different fonts, then your Font Cache can become corrupt and sluggish over time. You can clear and rebuild the Font Cache at start-up by issuing the following command:

atsutil databases -remove

Replace ‘-remove’ with ‘-removeUser’ to only clear the current user’s cache.

Step 6: Switch screenshot format

If you use the shortcut keys to take screenshots (CMD+SHIFT+3) – the default filetype is png. You can save yourself some conversion time by changing that default filetype. Terminal comes to the rescue. Enter:

defaults write type jpg

Your Mac also supports bmp, tif and gif – all you need to do is swap ‘jpg’ out for one of those.

Step 7: Add ‘Quit Finder’

Wouldn’t it be nice to be able to get out of system slowdown by rebooting the Finder? Enter this command at the Terminal:

defaults write QuitMenuItem -bool YES

killall Finder

If your sluggish system hangs frequently, you can now banish with the spinning beach ball by choosing ‘Quit Finder’ from the Finder menu.

Step 8: Plain emails

People who send HTML emails – we’re too busy to look at your spam. Set all mails to display with plain text in the preview pane by entering this at the Terminal:

defaults write PreferPlainText -bool TRUE

Restart Mail and HTML has gone forever. Unless you revert back, using the same command with ‘FALSE’ instead of ‘TRUE’.

Step 9: Recent applications

Wouldn’t it be handy to have quick access to the applications you use the most? This command creates a Stack – a fancy folder in your Dock – that lists the last few applications you used.

defaults write persistent-others -array-add ‘{ “tile-data” = { “list-type” = 1; }; “tile-type” = “recents-tile”; }’

Don’t forget to refresh the Dock.

Step 10: Empty Trash

You know when you empty the trash and OS X asks you whether you really want to empty the trash, wasting valuable microseconds of pizza-eating time? Use the Terminal to shut OS X up. Use the command:

defaults write WarnOnEmptyTrash -bool false

Now OS X will let you delete files without nagging you about it.

Step 11: Run maintenance scripts

OS X is highly optimised, running its own cleanup routines on a scheduled basis. It does no harm to run these manually though. Use the command:

sudo periodic daily weekly monthly

You’ll be prompted to enter your password and all maintenance scripts straight away.

Step 12: Autocomplete

To finish off, here are a few tips that make using the Terminal a bit faster. Firstly, want to complete paths quickly when typing in the terminal? Hit TAB and OS X does it for you. An even quicker way to add full paths to commands is to drag and drop folders from the Finder directly into the Terminal window.

Step 13: Terminal anywhere

You can add a command to the contextual menu that opens the Terminal at the folder you’re currently navigating in the Finder. Open System Preferences and click on Keyboard. Choose the Keyboard Shortcuts tab and Select ‘Services’. You’ll see a full list of add-on commands.

Step 14: Use the menu

Drill down the list to the ‘New Terminal at Folder’ entry and tick the box to switch the feature on. Now, right-click within any folder in the Finder and you’ll see the command at the bottom of the contextual menu. Select it and the Terminal will pop up, with the folder you want to work in ready to access.

Step 15: Look it up

You know that OS X is built over a kernel derived from UNIX, right? That means many standard UNIX commands work in the OS X Terminal. The easiest way to find out what a command does and how it works is to use the built-in manual, invoked with ‘man’. In Mountain Lion, you can right-click and open the man page for any highlighted command, that bit more quickly.

Bonus Tip: Terminal replacement

When is Terminal not Terminal? When it’s a Terminal replacement. TotalTerminal is one of the pack leaders. Previously known as Visor, TotalTerminal slides into view from the menubar (or any part of the screen you choose) when you hit a shortcut. It doesn’t replace the OS X Terminal. Rather, the plugin adds features to your Mac’s – like colour coding, copy on select and paste on right-click.

Then there’s iTerm2 – a full replacement for Terminal that focuses on better performance and extra features you won’t find normally in OS X. Those include a split screen interface, mouseless copying, built-in search and a 256-colour interface. If you’re serious about unlocking the power of your Mac with Terminal commands, either app is worth the download.


2 people were compelled to have their say. We encourage you to do the same..

  1. QA says:

    The above tips are great, but the two worst GUI failures of Mountain Lion are still:
    (1) Transitions when switching spaces cannot be sped up or eliminated.
    (2) Full screen animations cannot be sped up or eliminated.

    I moved from Snow Leopard out of necessity because certain software is no longer supported. Mountain Lion is just as awful as I expected. It’s an insult to pro users, making us wait a second here, a second there, and with no way to hack it back to a usable state. Maybe iPad using grannies feel at home with the flashy animations, but I feel they disrespect my valuable time.

  2. megadr01d says:

    When Finder starts misbehaving, you can also hold [Option], right click on its dock icon and choose “Relaunch”.

Leave a Comment

Please keep your comments friendly on the topic.

Contact us