How to change your pair Networks shell prompt

This is not an earth-changing post. Actually, I am still trying to set up WordPress to meet my basic requirements for getting started with building a blog. I have set up some basic plugins for anti-spam, page caching, contact forms, database cleaning, and Security. Security was a big one!! Today, I added a plugin, Enlighter — Customizable Syntax Highlighter, to enable me to include snippets of code in my posts.

So I wanted to try out this new plugin with a simple post about how I have customized my shell prompt when I ssh into my pair Networks shared host. That’s one of the features that I really love about pair Networks.

This is what my shell prompt looks like after logging in:

altopl@www2: /usr/home/altopl
==>

It shows “who” is logged into “what” server. I use the same bash prompt on all the Linux/FreeBSD servers that I use. So I know at glance which server and account I am using. I usually have a bunch of terminal windows open on my Mac. It also shows the current working directory, for example, my Website root directory:

altopl@www2: /usr/home/altopl
==> cd ~/*html/altoplace.com

altopl@www2: /usr/home/altopl/public_html/altoplace.com
==>

This is how I set the above shell prompt in my bash .profile:

PS1='
\u@\h: $PWD
==> '

Be sure to include the above after any “.bashrc” include statements:

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
        . "$HOME/.bashrc"
    fi
fi

PS1='
\u@\h: $PWD
==> '

I hope that was useful for someone! And, it gave me a chance to tryout the Enlighter — Customizable Syntax Highlighter plugin!

Leave a Comment