At their heart, Macs are very tweakable machines. OSX is a great operating system because most settings work just fine as they are, but with a few simple Terminal commands you can change just about anything that doesn’t suit you perfectly.
These commands are called Defaults Write Commands, and when entered into the OSX command line, called Terminal, they can totally change your experience and make a lot of aspects of OSX better. Here are the 10 most useful defaults write commands for OSX.
Note: For any of the commands listed below, you can un-do them by simply replacing the No or False Flags with Yes or True, and vice versa.
New to Terminal? Get the basics about it here before going any further.
Quit Pasting Full Names in Mail.app
When you copy/paste an email address inside of Apple’s default mail application, you not only get the email address, but also the name of the person. Sometimes this can be useful, but most of the time it’s just a pain and you end up deleting the name portion of the paste.
Enter this command into Terminal to make this action only copy the email address:
defaults write com.apple.mail AddressesIncludeNameOnPasteboard -bool false
Fix The Auto Hiding Dock
Depending on the size of your screen, the Dock can sometimes get in the way. Auto-hiding it is a great idea, but the delay that OSX forces on its reappearance can be a real pain. Enter the following command into Terminal to remove the delay and have the dock hide and show instantly.
defaults write com.apple.Dock autohide-delay -float 0 && killall Dock
If for some crazy reason you want to reinstate the delay, enter this command into terminal to put things back to normal.
defaults delete com.apple.Dock autohide-delay && killall Dock
Speed Up Mission Control
Mission Control, which was introduced in OSX 10.7 Lion, is great at hiding and showing windows, applications, and your desktop. The animations that it uses, however, could use a little bit more speed. To increase the speed of these animations enter the command below.
defaults write com.apple.dock expose-animation-duration -float 0.12 && killall Dock
Now, your windows will move with the speed of a gazelle rather than just a Lion.
Show Which Apps Are Hidden In The Dock
Hiding apps (Command + H) in OSX is a great way to get an app off of your desktop without minimizing it or closing it. The Dock doesn’t let you know which open apps are hidden, though, which can cause confusion. Entering the following command will give hidden apps a translucent icon to show this better.
defaults write com.apple.Dock showhidden -bool YES && killall Dock
Select Text In Quick Look
OSX allows you to tap the spacebar when a file is selected to quickly look at the file. Currently you cannot select any text in a text file when using quick look. With the command below, however, you can click and select text in quick look, allowing for easy copy/paste without ever needing to open the file.
defaults write com.apple.finder QLEnableTextSelection -bool TRUE;killall Finder
Change The Default Screenshot Image Format
When you take a screen shot in OSX the image is saved as a PNG file. This is great for transparency images, but for screen shots, the JPG format offers better compression. To change the default screen shot format from PNG to JPG, enter the following command into Terminal.
defaults write com.apple.screencapture type jpg && killall SystemUIServer
To change this back, or to change to another format, simply replace jpg with the extension of your choice.
Change the Default Screen Shot File Name
Speaking of screen shots, OSX by default names screen shots with the date and time the shot was taken, along with the words “Screen Shot”. You can change this default to be something more appealing, like your computer’s name so you know where the screen shot came from. Just enter the following command into Terminal.
defaults write com.apple.screencapture name "Brian MB Pro" && killall SystemUIServer
Replace “Brian MB Pro” with what you want your screen shot to be, and you’re all set.
Turn Off Default iCloud Saving in OSX Lion
By default, OSX Lion will save files like Pages and Text documents to iCloud. While this is great for a cloud-based backup of your files, it can be a pain if your Internet connection goes out, or if you are somewhere without a connection at all.
If you would rather those default to your local machine, just enter the command below.
defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false
Now, when you save a file in an Apple-centric application, the default location will be your computer, not iCloud.
Change the Default Event Length in Calendar
When you create a new event in OSX Calendar (previously iCal) it defaults to one hour. You can change the default to be any time you want. Just enter the command below and replace the “30″ at the end with however long you want default events to be. Note: This has to be done in minutes, so for 2 hours, enter 120.
defaults write com.apple.iCal "Default duration in minutes for new event" 30
Clearing Your History
Ok, this isn’t so much a defaults write command, but if you’re constantly using Terminal commands and need to clear things up so it’s somewhat searchable again, this simple command will help you out.
To clear your Terminal history, simply enter the following and hit Enter.
This will clear the history of all previously entered commands.
That just about does it. There are hundreds of other commands out there to tweak OSX from Terminal, but these are the most useful ones. Be careful working in Terminal, as there is no “undo” button there. Also, it’s important to mention that Terminal is VERY case-sensitive, so dock is not the same as Dock. Remembering that will save you a lot of headaches when using these commands.