1834047 Members
2586 Online
110063 Solutions
New Discussion

Changing the prompt

 
SOLVED
Go to solution
Prasad Joshi
Regular Advisor

Changing the prompt

Hi all,

I currently see my prompt as this
bash-2.02#

but, i want to change it something having
HOSTNAME and having PWD appended to it.

How can i change it?

Thanks & regards,
Prasad.
6 REPLIES 6
m saravanan
Valued Contributor
Solution

Re: Changing the prompt

Prasasd,

Put this following entry in your .profile

PS1="`hostname`$PWD =>"
export PS1



Hope it'll help u.


Regds,
Saravanan
RAC_1
Honored Contributor

Re: Changing the prompt

With bash shell, it is little different. Put this in .bashprofile or set variable PS1 as follows.

export PS1='\h(\!)${PWD}>'
There is no substitute to HARDWORK
Enrico P.
Honored Contributor

Re: Changing the prompt

Hi,
put

export PS1=$(hostname)':$PWD # '

in your

.bash_profile

Enrico
Arunvijai_4
Honored Contributor

Re: Changing the prompt

Hi Prasad,

Just export PS1 variable in your .profile,

export PS1="`tput bold``uname -n``tput rmso` \$PWD #"

This will display hostname in bold and PWD.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Prasad Joshi
Regular Advisor

Re: Changing the prompt

Thaks a lot.
Raj D.
Honored Contributor

Re: Changing the prompt

Hi Prasad,

You can set Prompt also like this:

# export PS1="`tput smso` `hostname` : `tput rmso ; tput bold` \$PWD `tput rmso` > "



Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "