Computer Nerdery

Random Terminal Message of the Day

Dan Moren posted a Terminal Message of the Day tip on Six Colors a few days ago, and I decided I would configure my Mac with a MOTD as well. However, I want a random one from a list every time I open a terminal rather than seeing the same one over and over.

The easiest way to do this is to avoid the /etc/motd file altogether and use a script to read a random line out of a text file and display that when you open a terminal window. There are three parts to this, two of which take all the work: a text file full of messages of the day, a script to randomly grab one, and a means by which to execute it automatically when you open terminal.

Find a place on your Mac you want to store scripts, if you don’t already have one. …

(Read More)