Wednesday, March 13, 2013

Pimp and personalize your Terminal Prompt

Around 16 years ago during the dot-com boom, I was getting my first exposure to remote console access.  Logging into a UNIX server back in those days was a real treat. It had much more intimacy as sysadmins would often personalize their lair.
Today, with Puppets, Chefs and virtualization, scores of machines and servers are created on-the-fly. Virtualization and cloud computing has desensitized the experience.

Today, I don't even know what I'm logging into. Single VM instances run small web applications unlike before when a massive server would handle a variety of tasks. This is what I typically see:

Which brings me to today's blog post. Personalization in the console. With things like ASCII art, MOTDs, and even editing bash profiles, you can bring some of that intimacy back.

Now, doesn't these screenshots below look more personal.

MOTD (Message of the Day) is a text file sysadmins usually personalize for end users login in. Today, MOTDs are often system auto-generated to display stats.
You can re-claim that back rather easily. Or, you can append to the default MOTD by adding a file /etc/motd.tail on most *NIX operating systems.

I normally head over to several ASCII sites and download some goofy ascii art to give the servers some more bling.

Some interesting tools.

There are a few things in Linux you can use to customize your MOTDs.

First, there is linux_logo (apt-get install linux_logo on Debian or pacman -S linux_logo on arch).

This will give you the ability to generate a few great system logos.

To list available logos, type in: linux_logo -L list

Then to choose, type linux_logo -L X (number from the list)

If you want to pipe it out to a text file, you can do: linux_logo -L 26 > ubuntu.motd.txt

Another tool is figlet which is an ascii text banner creator. Figlet is pretty straightforward and instructions in the man pages is to the point.

Here, I have a centered logo with a slight slant:
figlet -cf slant "my text"
-c = center
-f = format

Now combine the some ascii art with ascii text decorations, you can have something like these:

As you can see, with little effort, you can stylize your terminal login prompts.

No comments:

Post a Comment