Set an informative prompt

Sometime when I’m working in UNIX I get lost in the maze of directories, and sometimes I can be working on a few different systems at the same time. So i find it very helpful to set an informative prompt.
The command below, when adding to your .bash_profile or .proifle will make your prompt look something like this:


Add this to you .bash_profile or .proifle file, logout and login again.

PS1='${LOGNAME}@${HOSTNAME}:${PWD}>'; export PS1

You may need to set the HOSTNAME environment variable for the hostname part to work, like this:
HOSTNAME=`hostname`; export HOSTNAME

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s