Bash prompt goodies – PS1 varible

sample

In the above picture you see useful thing:

the user name is Red colored, host name is Blue and current directory is colored with Black. This will help you while you are working with multiple tab at a time-

In bash you can customize you prompt using the environment variable PS1. In order to get the above result insert the following in your .bashrc or .profile file.

export PS1=”\e[1;31m\]\u\e[1;30m\]@\e[1;34m\]\h \e[0;30m\]\w$ “

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s


%d bloggers like this: