bashpathhome-directory

bash PS1 shows /home/boom/git instead of ~/git


When I start bash, it looks like boom@server:~$, but when I start changing current directory, it shows full path. Even if I switch dir back to home, it shows boom@server:/home/boom$. how can I fix that?

using Ubuntu Server 20.04.1 LTS amd64


Solution

  • The backslash at the end of your $HOME variable is the problem. Try first

    HOME=/home/boom
    

    and everything is normal. Search in ~/.profile and/or ~/.bashrc files where your $HOME variable is set.