Fun with Terminal

September 19, 2008 in UNIX, Open Source | 8 Comments

Indeed, there are many easter eggs inside your Terminal, but I believe these Terminal command lines will make you smile as it's really fun to play around with. And for some, I am sure you've never seen them before.

Birth Token

cat /usr/share/misc/birthtoken | grep [month]

This Terminal command line will show you what is the birth flower and birth stone for the given birth month, instantly.

$cat /usr/share/misc/birthtoken | grep Jan
January:Garnet:Carnation

Meaning of Flowers

cat /usr/share/misc/flowers | grep -i [flower-name]

Do you know that Camelia means reflected loveliness? Terminal knows it.

$cat /usr/share/misc/flowers | grep -i Clover
Clover:Be mine.

Milestones in Music

cat /usr/share/calendar/calendar.music | grep [month/date]

Show you the date of birth of milestones in music related to the given month and date parameter.

$cat /usr/share/calendar/calendar.music | grep 01/10
01/10	Blues guitarist Howlin' Wolf dies in Chicago, 1976
01/10	Jim Croce is born in Philadelphia, 1943
01/10	Pat Benatar is born in Long Island, 1952
01/10	Rod Stewart is born in Glasgow, Scotland, 1945

Proper Names

cat /usr/share/dict/propernames | grep [portion-of-name]

This command line, if executed, will return you completed names from the give portion of name. Whether it's proper or not, I doubt.

$cat /usr/share/dict/propernames | grep Te
Ted
Teresa
Teri
Teriann
Terrance
Terrence
Terri
Terry
Teruyuki

Birthdays

cat /usr/share/calendar/calendar.birthday | grep [month/date]
cat /usr/share/calendar/calendar.birthday | grep [name]

This particular Terminal command line will show you the birthdays of some famous people. Not so breaking though, I can't even find Steve Jobs and Bill Gates birthdays inside.

$cat /usr/share/calendar/calendar.birthday | grep 09/16
09/16	Allen Funt born in Brooklyn, NY, 1914

$cat /usr/share/calendar/calendar.birthday | grep Steve
07/25	Steve Goodman is born in Chicago, 1948
11/13	Robert Louis Stevenson born, 1850

Extra

Thanks to reader James Hindle for pointing out that we can see today's music, history, computer and birthday everytime we open up our Terminal, here is how to do it:

  1. Open Terminal and type vim ~/.bash_profile
  2. Press character i to go to Insert Mode
  3. Insert the Terminal commands
    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
    
  4. Quit Insert Mode by pressing Escape key
  5. Type :wq to save the changes to the file and exit vim mode
  6. Relaunch your Terminal and now you should be able to see the changes

Keep Up to Date

We will come up with more and more interesting topics over the time, make sure to keep yourself up to date using RSS Feeds or Email Subscription.

Related Entries

Some articles taken from our resource base, tightly related to current article, to empower you with more knowledge on tweaking the most out of your Mac.

  1. Emacs. Bizarre Findings
  2. Safari 4 Beta. New Features and Tweaks
  3. Stunning Mac Setups 3: The Minimalist Effect
  4. Twiddle with Terminal Command Prompt
  5. Telnet's ASCII Animation: Star Wars
  6. Terminal Kills Process
  7. Mac OS X Dock Pillows
  8. Mac Dictionary, Secret Words

8 Comments

09:11 PM

James Hindle

If you put the following in ~/bash_profile, every time you open a terminal window it will print today's birthdays, and world, music and computer history milestones: 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

Reply | Back to Top

09:26 PM

Wendy <Webmaster>

Thanks for that James. I will plug it to the article.

Reply | Back to Top

12:17 AM

Jeff Jolley

There is a command-line program to get the calendar stuff out: /usr/bin/calendar. Normally, you do "calendar -f {calendar-file}", so:

calendar -f calendar.music

will give you the music calendar. It will also automatically do stuff like, if today is Friday, it will show you Saturday and Sunday's calendar events so you won't miss them over the weekend when you're not at work. It's very cool. You can customize how you want your calendars to work by copying the calendars from the /usr/share/calendar directory to the ~/.calendar director. (You will have to create that directory, of course). "man calendar" for more information.

I find it easiest to combine calendars (music/usholidays/birthdays) into one calendar in my home directory and adding a custom calendar directive into my .profile. View /usr/share/calendar/calendar.all to see how to combine calendars.

Reply | Back to Top

12:09 PM

Ben

Hey, so i tried using James' little extra, BUT by accident I forgot to put a space between date and the first ", and now whenever I open up Terminal it only displays the Last login info and then the following: -bash: date"+%,/%d" : No such file or directory and then blank, and I can't enter any code. Please help!!

Reply | Back to Top

01:18 AM

Zach

just hold ctrl and click c

Reply | Back to Top

05:07 AM

Miji

I got a few : emacs *enter* *F10* *t* *g* *select a game from the list of games* telnet towel.blinkenlights.nl say Hi, I'm a mac

Reply | Back to Top

12:06 AM

Ajan

hey I tried the SUDO command to try putting a message on the Login window, though I cancelled it as soon as I copy pasted the command.. Now my Terminal window Looks like this http://i164.photobucket.com/albums/u39/ajan011/Picture3.png , I tried resetting the look of the terminal in preferences by changing it to default (I'm using a 10.5.6). I can't see my user name now. And everytime I try writing something, it doesn't show it (as if its written in white). Tried removing the plist and reinstalling terminal. Still no,change. Help me out guys..

Reply | Back to Top

11:55 PM

Goomba4001

I've been looking around usr/share/ for a bit, and I found some goodies: Richard Stallman Interview (WTF? XD): cat /usr/share/emacs/22.1/etc/INTERVIEW How to say "Hello" in every language: cat /usr/share/emacs/22.1/etc/HELLO Some cheesey GNU puns, EMACS acronyms, and some funny developers dialogue: cat /usr/share/emacs/22.1/etc/JOKES (I personally love it when one of the writers gets irritated with the bash, and tells it to "eat flaming death") Strange article on motivation and rewards. And why is this on my Mac...? cat /usr/share/emacs/22.1/etc/MOTIVATION OH MY GOSH. What the hell is wrong with these people? XD cat /usr/share/emacs/22.1/etc/sex.6 Bizarrity. cat /usr/share/emacs/22.1/yow.lines

Reply | Back to Top

Post a Comment

Rest assure, your email address will be secured, encrypted and locked down to our treasure box. Upon filling your comment, we only allow <a>, <b> and <br> tags .

You can't be anonymous

C'mon, I'm sure you've got something to say.