When I use \w to set my prompt in bashrc (using ubuntu, if it makes a difference)
it shows prompt as
~/sources
vivek-laptop:vivek
while i want it to be like
/home/vivek/sources
vivek-laptop:vivek
Where am I making the mistake?
Printable View
When I use \w to set my prompt in bashrc (using ubuntu, if it makes a difference)
it shows prompt as
~/sources
vivek-laptop:vivek
while i want it to be like
/home/vivek/sources
vivek-laptop:vivek
Where am I making the mistake?
That is not a relative path. The tilde (~) is your home directory. Eg, if you log in as root and go to the same place, you will see /home/vivek, since ~ for root is (usually) /root.
I don't think you would be using the bash prompt in this way, but generally if you need to replace a ~ which has been output it is equal to the $HOME environment variable.
okay, let's try that again. . . you'd want to put this in (somewhere)and the best thing to do is to try it out first via export PS1="\${PWD}# "Code:PS1="\${PWD}# "