The Terminal welcomes you back

MOTD displays when opening Terminal or opening a new tab in Terminal

I blame @tompy_ for the little change I made to my Terminal today. He had set a piece of software called RStudio to print a certain phrase if a file was successfully loaded. Gaining inspiration from the screenshot which I had initially thought was a normal, though customised, terminal window I felt the urge to follow suit.

I recall once while Ruben was still developing his tcshrc configuration file for his tcsh shell, he had changed his Terminal’s message of the day (MOTD) which is what I set out to do today. While the same thing could have been achieved through editing part of the tcshrc file he has since given me to use, it didn’t occur to me at the time to follow this method.

Any half-decent search on the internet will put out a thousand and then some posts with the exact same way to achieve setting a message of the day, however I will post it here nonetheless. Of course, being a change to your Terminal, this application needs to be opened before any commands can be entered and additionally requires root access.

% sudo pico /etc/motd

This will ask for the password (if you know it), and after input of a correct one takes you to Vim where you can input a message. Some choose to put a line, as I did, or some choose to input ASCII art. Either way, I would recommend putting a blank line after whatever you input so it isn’t mushed against the prompt of the terminal.

Control-X will allow you to save and exit after following the prompts.

Process of setting the MOTD in Terminal

After analysing some of Ruben’s tcshrc configuration file however, it seems the same can be achieved by using the following code (in my case, in addition to the code Ruben has already set). I haven’t tested it however so I don’t know if this is really correct and/or if it only works for the tcsh shell (though I get the impression it isn’t that limited), but don’t forget to change that mention of tcsh to something else if you’re using a different shell.

#!/usr/bin/env tcsh

echo おかえりなさいませ、ご主人様♡

Happy customising! :’D