how to make ps1 display full path name
11,591
Replace the "\w" with "\$PWD"
[\u@\h ]\$PWD$
See also https://help.ubuntu.com/community/CustomizingBashPrompt
Author by
user214877
Updated on September 18, 2022Comments
-
user214877 almost 2 years
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?
-
fiatux over 10 yearsYou should not escape the dollar sign if you use single quotes:
PS1='[\u@\h $PWD]\$ '