1

using ubuntu 12.04.3, i've modified my PS1 to [\u@\h ]\w$ which SHOULD display as follows:

[user@host /home/user]$  

but it doesn't it's still

[user@host ~]$  

this used to work. what changed?

1

Replace the "\w" with "\$PWD"

[\u@\h ]\$PWD$

See also https://help.ubuntu.com/community/CustomizingBashPrompt

  • You should not escape the dollar sign if you use single quotes: PS1='[\u@\h $PWD]\$ ' – glenn jackman Dec 10 '13 at 22:01

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.