I have changed my host and hostname by editing the files /etc/hosts
and /etc/hostname
.
But this won't affect what appears as my terminal prompt. It still shows my old_host@new_hostname
. How to get the prompt show up new_host@new_hostname
?
I have changed my host and hostname by editing the files /etc/hosts
and /etc/hostname
.
But this won't affect what appears as my terminal prompt. It still shows my old_host@new_hostname
. How to get the prompt show up new_host@new_hostname
?
What appears at your command prompt is stored in the variable $PS1
. It is generally in the format username@hostname:~$
(depending on your current directory and whether you are root of course).
It sounds like your hostname was changed successfully. I'm not sure why you edited your /etc/hosts
file but I doubt it would have achieved what you're thinking it should...
Update: Here is some info on changing your username and home folder
Your options are to create a new user (and have your old home folder contents moved) or rename your old user and home folder.
You won't be able to change your username while logged in under the same account, so you have several options for getting around this:
There is too much to get into here, so you should read over the content on the following links for details on the exact steps to take. Don't do anything until you feel comfortable with the steps.
How do I change my username?
http://www.ubuntututorials.com/change-username-ubuntu-12-04/
https://www.liberiangeek.net/2012/12/how-to-easily-change-your-username-in-ubuntu-12-10-quantal-quetzal/