2

I want to change something@something-pcname:~$ to somethingElse@somethingElse-pcname:~$. I

have already tried changing the user name from something to somethingElse but the terminal still displays something@something

1
  • Have you change on this "/etc/hostname" and this "/etc/hosts" ?
    – penreturns
    Oct 29, 2013 at 9:13

2 Answers 2

3

First you need to add a new user of name something

sudo adduser something

then switch to that account

su something

Open the /etc/hostname file in your favourite text editor, for example

sudo vim /etc/hostname 

and edit the computer name to somethingElse-pcname Done!

1
  • I don't see how creating a new user does what OP wants
    – Zanna
    Dec 5, 2016 at 19:38
2

You can change the global variable PS1

PS1='somethingElse'

To make it persistent add the above line to the end of your ~/.bashrc and reload it with

source ~/.bashrc

the standard (in your ~/.bashrc) is something like

${debian_chroot:+($debian_chroot)}\u@\h:\w\$

so you can play around with this.

have a look at this site for some useful variables in the bash prompt (here)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .