It’s been four years now since the Mac OS adopted its Unix underpinnings, but many of us are still getting used to the rich heritage that dwells beneath OS X’s Aqua interface. I was reminded of this the other day while leafing through old OS X Hints columns from the August 2004 issue in which Rob Griffiths revealed a fun Terminal Easter egg inherited from BSD Unix: Open Terminal (/Applications/Utilities) and type:
cat /usr/share/calendar/calendar.history | grep "LOTR"
Before you can say “Mellon!” you’ll see a list of important dates from The Hobbit and The Lord of the Rings . For instance, on July 4, Saruman imprisoned Gandalf in the tower of Orthanc.
That got me wondering: What other odd Terminal treasures might there for the taking? Here are just a few that I found.
• Text-based Tetris: If you’re a fan of Tetris—that strangely addictive game of the late ’80s/early ’90s—you’ll be happy to know it’s already on your Mac. In Terminal, type
emacsand then press Return. You’ll see a screen-full of text instructions for Emacs, a powerful, programmable Unix text editor. Press Esc, then x, then type
tetristo see the game window. Up and down arrows rotate the shapes. Left and right arrows move them. Press the spacebar to drop a shape.
Not surprisingly, Emacs is about as easy to figure out as a Rubix cube. To exit it, press control-X and then control-C. (If your keyboard doesn’t have a control key, go through the menu bars: press ESC ` [ESC-backtick], type
f, and then type
Afternoon Adventures: I have fond childhood memories of typing my way past dragons and other dangers at a terminal in a Vanderbilt University computer lab. I played Adventure each week while waiting for my professor step-father to finish advising his graduate students.
Emacs obliges with the text-based adventure game Dunnit. Type
emacsand then press Return. Press Esc, then x. Type
dunnetand start wandering. If you’re stumped, you can visit this spoiler site for help. (Some basics: to pick up an object, use the word “get,” as in
get shovel; to move, type the direction, as in
east; to examine an object, use the word “examine,” as in
Free Psychotherapy: If you’re feeling blue after scoring poorly at Tetris or falling prey to the Dunnit bear, Emacs can help once more. Type
emacsand then press Return. Press Esc, then x, and now type
doctor. Type a description of your anguish at the prompt and then press Return twice. Keep typing until you feel better.
I’ve only shared a few Emacs games here (for a complete list, type
ls /usr/share/emacs/21.2/lisp/playat a Terminal prompt). If you have any fun Terminal tricks, tell us all about them on the forums.