Terminal (in Applications/Utilities) gives you direct access to the UNIX system that underpins Mac OS X. By typing specific
commands into your Terminal window, you can make
changes, open settings, or access features that
aren’t available by any other means.
After typing one of the commands listed here,
press Return to activate it. Commands split over two
or more lines should be typed in their entirety—don’t
Get extra mileage from your Mac using OS X’s Terminal. BY IAN OSBORNE
press Return halfway through. And bear in mind that
some commands are case-sensitive, so be true to
exactly what’s printed here. (Or head over to
MacLife.com/25Terminal Tips to cut and paste the
commands directly.) One final warning: All the tips
in this feature have been thoroughly tested, but
experimenting with the Terminal is not a task to be
undertaken lightly. Don’t try to modify or adapt these
commands unless you really know what you’re doing.
1. iROBOT
Your Mac can talk to you. Using a robotic
voice reminiscent of a 1950s sci-fi flick, it can
ask after your health, tell you a joke, or say
anything else you care to type. It’s a simple
trick. Just open the Terminal application and
enter: say Mac Life
And the Terminal robot utters the name of
this magazine. Obviously it doesn’t have to
be Mac|Life—type anything you like. Give it a
go; it’s fun.
2. BACK UP AT WILL
By default, Time Machine backups take place
every hour, but you can change this through
the Terminal. To make it back up every half
hour instead, simply type:
sudo defaults write
/System/Library/LaunchDaemons/
com.apple.backupd-auto StartInterval
-int 1800
The 1800 at the end of this command is
a half hour, expressed in seconds. You can
change this figure to suit: For example, to
back up once an hour again, replace it with
3600, and for two-hour backups, use 7200.
Always remember to be especially careful
with commands that begin with “sudo.”
These are system-level commands that can
cause huge problems if misused, which is
why you’re asked for your administrator’s
password the first time you try one.
3. LOGIN GREETINGS
Another sudo (and therefore dangerous)
command enables you to add a message to
the login window. In the Terminal, type:
sudo defaults write /Library/
Preferences/com.apple.loginwindow
LoginwindowText “Your Message”
Replace Your Message with whatever it
is you want to display, of course, but leave
the quotation marks around it intact, and
be careful with your punctuation. Some
characters (exclamation points, for instance)
stop the command from working.
To remove the message, type:
sudo defaults write /Library/
Preferences/com.apple.loginwindow
LoginwindowText “”
As you may know, OS X is UNIX-based. Emacs, a text editor, forms part of the UNIX system, and it
contains some Easter egg games, including the ever-popular Tetris, Pong, and Snake. First you must
find your Emacs version number. In the Terminal, type cd /usr/share/emacs/
Press Return. Now type ls (lowercase LS) and press Return again. You’re given your Emacs
version number ( 1. 21, for instance). Write it down. Then enter the following:
ls /usr/share/emacs/[VERSION]/lisp/play
Replace [VERSION] with the number obtained earlier (no parentheses). You get a directory of
all the available games. Make a note, or take a screenshot. Now switch to Emacs through Terminal
by simply typing emacs. To access the games, press Escape, then X, and type the name of the
game you want to play before pressing Return. You can switch to the next game by pressing
Escape, X, and the name of the next game. Have fun!
A variety of simple games—like
Pong—are accessible via the Terminal.