Show Full Path in Shell (bash)

Lets say you have to navigate to a long directory like /var/www/vhosts/mydomain.tld/httpdocs/myfolder/ etc

even if you give the command “cd /var/www/vhosts/mydomain.tld/httpdocs/myfolder/” at your shell window you will see only your username and the last folder , something like “root /myfolder#” in order you view the full path without having to use the pwd command every time,

go to your user’s home directory vi ~/.bash_profile
and add the following line:
export PS1=”\u \w# ”

save it and logout/relogin.

Advertisment

Leave a Reply

You must be logged in to post a comment.