Redhat – How to add Label in shell Prompt

Posted: June 18, 2010 in Redhat

If you have several Redhat Server and want to have Customize Label on each Shell Prompt for easily Identifying , Do the following .

[root@localhost]#vi /etc/profile

Look for the paragraph like below and edit

for i in /etc/profile.d/*.sh ; do
if [ -r “$i” ]; then
. $i
fi
done
PS1=”[\u@\h|Test-Server]\\$”
unset i
unset pathmunge

Then save and exit , logout and log in back again , You will see the shell prompt like this.

[root@Test-Server]

Hope This helps..

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