You are not logged in.

#1 2018-02-15 22:50:24

jonhykrazy
Member
Registered: 2018-02-15
Posts: 2

[SOLVED] Appearing name of home directory instead of ~

So I reinstalled arch linux because of a problem I was having but decided to leave my /home partition untouched, so let's say I had home/name for my user.

Usually, before the formatting, it would say [user@hostname ~]$, but since the reinstallation it always appears [user@hostname name]$. I know it's nothing major but I'd like to change that.
Doing cd ~ brings me to the "name" directory aswell as cd $HOME. I created my user with useradd -g wheel name and once it was created I did usermod -d /home/name name so that it would go to the right directory, however it's having that small issue. Any idea on how I could fix this?

Thanks in advance.

Last edited by jonhykrazy (2018-02-16 00:25:23)

Offline

#2 2018-02-15 23:50:47

circleface
Member
Registered: 2012-05-26
Posts: 639

Re: [SOLVED] Appearing name of home directory instead of ~

[\u@\h \W]\$ does it the way you want on my computer.  Just set $PS1 to that and it should work.

Offline

#3 2018-02-16 00:19:40

jonhykrazy
Member
Registered: 2018-02-15
Posts: 2

Re: [SOLVED] Appearing name of home directory instead of ~

Wasn't aware of that! Thanks for the comment, but I realized that the $HOME was set inproperly.
echo $HOME would give me /home/name/ but dirs would give me /home/name. Doing export HOME=/home/name worked!

edit: that was a bad idea as I had read before on the wiki so I logged in as root and did usermod -d /home/name properly, this time without the / at the end and it works fine.

Last edited by jonhykrazy (2018-02-16 00:23:52)

Offline

Board footer

Powered by FluxBB