• On BNET: Why Domino's admitted its pizza sucked
advertisement
July 24, 2009 10:03 AM PDT

Terminal fun: Games and more...

by CNET staff

Written by Topher Kessler

The OS X terminal has a variety of fun UNIX commands and resources that have been programmed in over the years. These include small databases of information and games, among other random additions; so if you're interested in looking up music history milestones, the meaning of various types of flowers, want to fire up old-school pong or tetris, or even see a full episode of Star Wars, forget about the internet and look no further than the OS X terminal.

Information databases

Open the terminal and type the following commands to get information on flowers and their meanings:

cat /usr/share/misc/flowers

Enter this command to see what precious stones and flowers are associated with a given birth month:

cat /usr/share/misc/birthtoken

This one will show a list of proper names based on any partial name used in the text in "INPUT"

cat /usr/share/dict/propernames | grep INPUT

These commands will list milestones in music, famous birthdays, history, or computer development:

cat /usr/share/calendar/calendar.music
cat /usr/share/calendar/calendar.birthday
cat /usr/share/calendar/calendar.history
cat /usr/share/calendar/calendar.computer

To put these to fun use, you can add them to your terminal's profile in order to have the computer automatically output the information pertaining to the current date whenever you launch the terminal. To do this, follow this procedure:

  1. Enter "pico ~/.bash_profile" in the terminal to open a simple text editor.
  2. Copy and paste the following into the terminal window:

    today=`date "+%m/%d"`
    grep $today /usr/share/calendar/calendar.music
    grep $today /usr/share/calendar/calendar.history
    grep $today /usr/share/calendar/calendar.computer
    grep $today /usr/share/calendar/calendar.birthday

  3. Press control-o followed by "y" to confirm saving of the buffer.
  4. Press control-x to quit the text editor.
  5. Open a new Terminal window and if anything happened on the current date, it will display along with the login information.

Emacs

In UNIX and Linux systems, the program "Emacs" is a complex text editor that has become popular among programmers, and through its development many people have contributed fun scripts to run with the program. These include small text animations, question and answer activities, and games. OS X comes with a full BSD subsystem that contains a full set of UNIX tools, including emacs, and therefore Mac users have access to these scripts that have been programmed for Emacs over the years.

To access them, open the Terminal and type "emacs" to launch the editor. Then press the escape key followed by the "x" key to go to the prompt for loading scripts. At this point you can enter any one of the following scripts to run. To quit emacs, press control-x followed by control-c, or just close the terminal window and confirm that you are quitting. This second option will force emacs to quit, but will not hurt anything.

Games:

5x5 -- change all the areas on the board to hash marks in the least number of moves
blackbox -- find four hidden balls in the box
decipher -- figure out the hidden message
dunnet -- small RPG game
gomoku -- create a row of 5
hanoi -- move disks around
mpuz -- figure out which numbers are being multiplied together
pong -- the classic pong game
snake -- wind your way through a maze and obstacles
solitaire -- remove as many pebbles from the board as possible
tetris -- the classic tetris game

Other:

animate -- animates text in fun phrases
dissociate -- mix up the current text
doctor -- diagnose any problem
landmark -- a neural-network robot
life -- pattern generator based on the "game of life" algorithm
morse -- convert the text to morse code
spook -- output random spy terms
yow -- returns the same line every time, used to output more.
zone -- text in the emacs buffer will slowly disintegrate and fall downwards


Banners!

Type "banner" in the terminal followed by a string of characters to output that string in large ASCII text, for instance:

banner Welcome!!!

You can also use redirection to output the banner to a text file that you can open and print.

banner Welcome!!! > ~/banner.txt

This file will be in your home folder.


Star Wars

If you would like to see a nearly full version of Star Wars Episode IV in ASCII characters, enter the following in the terminal:

telnet towel.blinkenlights.nl

Make your Mac sing or speak

This one isn't a new feature to OS X, but coupling a few sounds with the singing "Cello" text-to-speech voice will give you a nice tune. Enter the following command in the terminal to make the computer sing:

sudo osascript -e 'say "Dum dee dum dee dum dum dum dee dee dee lah lah lo fa lah lah lah lah lah lah fa lah dee doo dee doo" using "Cellos"'

For extra fun, you can make a remote mac sing this tune by logging in with SSH and running this command. You can also use this with other voices as well besides "Cello", and prank a friend by having the computer say something while they're working. Some alternative voices are: Alex, Bruce, Fred, and Junior, though any of the System Voices in the "Text to Speech" system preferences will do.

"...I'm watching you, Dave."


Others?

Unix has been around for decades, which has been plenty of time for geeks and programmers to make their mark and contribute a fun game of sorts. They are hidden all over the place, so if you know of others please let us know by posting it in the comments section below.

Be sure to check us out on Twitter and the CNET Mac forums.


Topher has been an avid Mac user for the past 10-15 years, and has been a contributing author to MacFixIt for just over a year now. One of his diehard passions has been troubleshooting Mac problems and making the best use of Macs and Apple hardware both for family and friends, as well as in the workplace. He and the newly formed MacFixIt team are hoping to bring enhanced and more personable content to our readers, and keep the MacFixIt community going here at CNET. If you have questions or comments for Topher or the other MacFixIt editors, feel free to contact us at http://www.macfixit.com/contact

Resources

  • Twitter
  • CNET Mac forums
  • http://www.macfixit.com/co...
  • More from Late-Breakers
  • Recent posts from MacFixIt
    iTunes 10 user interface sees some minor changes
    Apple seeds iOS 4.1 Gold Master to developers
    Possible fix for Harman Kardon iSub problems with PowerPC Macs
    Precautions to take before installing iTunes 10
    A reminder on how to reset your Mac's system password
    Mail messages appearing blank
    Adobe Lightroom update brings direct Facebook publishing; Camera Raw 6.2 released
    Weekly troubleshooting utilities update
    Add a Comment (Log in or register) (7 Comments)
    • prev
    • next
    by baltwo2 July 24, 2009 12:04 PM PDT
    pico? That's been replaced by nano since 2006.
    Reply to this comment
    by tkessler July 24, 2009 12:04 PM PDT
    <class="merchant"><span>&#62;</span><div class="datestamp"><i>This is a reply to a previous comment by baltwo2</i></div></class><br />
    If you type "pico" it will launch "nano"...
    Reply to this comment
    by CarlRJ July 24, 2009 2:41 PM PDT
    And why on earth would one need to use "sudo" to run osascript? That's not necessary. And, actually, there's been a direct command-line "say" command for a while, so you can just do this:<br>
    <code>say -v Cellos "Dum dee dum dee dum dum dum dee dee dee lah lah lo fa lah lah lah lah lah lah fa lah dee doo dee doo"</code><br>
    And while we're at it, telneting somewhere to watch ASCII Star Wars (which has been around a loooong time) is <b>NOT</b> "watching it without using the Internet".<br>
    And don't even get me started on using "cat filename | grep word" where one should be using "grep word filename" instead.<br>
    Plus, you kids get off my lawn!<br>
    Reply to this comment
    by tkessler July 24, 2009 2:41 PM PDT
    <class="merchant"><span>&#62;</span><div class="datestamp"><i>This is a reply to a previous comment by CarlRJ</i></div></class><br />
    It doesnt matter how it's done; rather, its just a fun set of things to do...but i guess some folks need to vent pointless frustrations somehow....shame.
    Reply to this comment
    by Fingal July 24, 2009 2:41 PM PDT
    <class="merchant"><span>&#62;&#62;</span><div class="datestamp"><i>This is a reply to a previous comment by tkessler</i></div></class><br />
    It's fun to play geekier than thou.
    Reply to this comment
    by Samasar July 24, 2009 2:41 PM PDT
    <class="merchant"><span>&#62;</span><div class="datestamp"><i>This is a reply to a previous comment by CarlRJ</i></div></class><br />
    I caught the playful tone. The end line gave it away.
    Peer Gynt, aye? Nice. :-)
    But cool movies or pictures like in the old days, that's what I want!!!
    Reply to this comment
    by Samasar July 26, 2009 11:13 PM PDT
    No flapping flags one can snap anymore?
    Reply to this comment
    (7 Comments)
    • prev
    • next
    advertisement

    About MacFixIt

    MacFixIt is CNET's troubleshooting resource for all things Mac. The information here helps you navigate the ins-and-outs of Mac ownership with how-tos, troubleshooting information, news, reviews, and more.

    Add this feed to your online news reader