Change the Terminal Message of the Day in Mac OS X
Whenever you launch the Terminal in Mac OS X, you may get a little message: “Welcome to Darwin!” or a “Last Login” time – well, after you’ve seen it a few hundred times you might be sick of it, or perhaps you’d prefer something more amusing, meaningful, or even useful to yourself and other computer users. That little message you’re seeing is the MOTD, otherwise called a Message of the Day, and it’s a simple text file located at /etc/motd.
We will show you how to change the MOTD in the Mac OS X Terminal to whatever you want, easily.
Checking the Current MOTD
Launch the Terminal and type:
$ cat /etc/motd
Unless you have already customized it, “Welcome to Darwin!” or the “Last Login” message will be what appears, depending on your version of OS X. Another option is if the /etc/motd file does not exist (which for many modern versions of OS X is the default case now), then nothing would appear except for the login details. But we don’t want that anymore, we want our very own motd message when a new terminal is launched, so here’s how to turn it into whatever you want.
How to Modify the Message of the Day (MOTD) to a Custom Message
Type the following into the command line, this will open the motd into nano, if you want to use another text editor like vim, that’s OK too:
sudo nano /etc/motd
nano is nothing more than a command line text editor, and works just like one. Line over and delete the text and type whatever you want in its place.
Let’s say we’ll place the message “Hello from OSXDaily.com!”
To save the changed MOTD file, you’ll hit control-O, and then hit return. That’s it. Then hit Control+X to exit out of nano editor.
Now when you launch the Terminal you’ll be greeted with your new message, in this case it may look like the following:
Hello from OSXDaily.com!
You can also choose to redirect output of a command to the motd file, including bash scripts or an existing command. For example, you could output uname or sw_vers like so:
sw_vers > /etc/motd
That would make the MOTD in OS X tell you the name, version, and build upon login, like so:
ProductName: Mac OS X
You can get as complicated or as simple as you want.
Note: Some users will be required to run nano as root, depending on their account privileges or what they’re logged into, this is done via the sudo command. Using the sudo command will prompt you for the administrators password. The appropriate sudo prefixed syntax would be:
$ sudo nano /etc/motd
The rest of the modification is the same.
If you want to remove the customized motd, just delete it from the /etc/motd file, or create a ‘.hushlogin’ file in the users root directory.