The Modern Web

Useful technology, techniques and stories from modern web development and design

How to add a custom welcome message to your terminal

Filed under: Terminal, Tips

Title card for the entry on adding a custom welcome message to your terminal

A quick terminal customization tip for showing a personal message whenever a new terminal window opens.

Where the message lives

Every time a shell starts, it reads a profile file from your home directory. Adding a line to that file means the line runs on every new window. That is the whole mechanism, and it is also how most terminal customisation works.

Adding the line

Open the profile file in an editor, add an echo command with the text you want, save it, and open a new terminal window. If nothing appears, the usual cause is that your shell reads a differently named profile file than the one you edited, which is worth confirming before assuming the change failed.

Making it slightly less plain

Once a message prints, the obvious next steps are printing the date, printing the current directory, or printing a short reminder of the project you are working on. Anything you can run at the prompt can run at startup.

The one thing worth avoiding is putting anything slow in that file. A command that takes two seconds to run turns every new terminal window into a two second wait, which stops being charming quickly.

The Modern Web · Copyright 2017 · Published with WordPress · Sitemap