Re: How do you change user name in terminal
Posted: Sat Jan 30, 2010 1:44 am
Run
and you should get something that looks like this:
${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\]
The part that shows what you see is the \u@\h in the middle. \u is the user, the @ is just an @ and \h is the hostname of your computer. To change what your prompt is, open your .bashrc file
create a new line at the bottom and add
paste in the output from the echo $PS1 command above, add an extra quotation mark at the end to close the command, then replace \u@\h with whatever you want to see. When you're finished you should have something that looks like this:
save the file and open a new terminal window to see the fruits of your effort.
If you want to save time experimenting with different looks, you can just run the PS1="..." command straight in the terminal window. Just keep in mind that the changes won't stick until you add the command to your .bashrc file. In the future if you ever want to change or undo what you did, just open the .bashrc file again and delete the line you added and everything will go back to normal.
Code: Select all
echo $PS1
${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\]
The part that shows what you see is the \u@\h in the middle. \u is the user, the @ is just an @ and \h is the hostname of your computer. To change what your prompt is, open your .bashrc file
Code: Select all
gedit ~/.bashrc
Code: Select all
PS1="
Code: Select all
PS1="${debian_chroot:+($debian_chroot)}\[\033[01;32m\]joeblow\[\033[01;34m\] \w \$\[\033[00m\]"
If you want to save time experimenting with different looks, you can just run the PS1="..." command straight in the terminal window. Just keep in mind that the changes won't stick until you add the command to your .bashrc file. In the future if you ever want to change or undo what you did, just open the .bashrc file again and delete the line you added and everything will go back to normal.