Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

This can be really trivial,but it helps in ways of making it more comfortable while coding and sending commands to terminal.

My terminal source/bash/root name(my apologies, I dunno which is the right word), reads as follows :

itachi@itachi-HP-Pavilion-g6-Notebook-PC:~$ 

Can you please tell me how Can I shorten this or change it? The second part after '@' is too long. Is there anyway to change this.? Thanks in advance..

share|improve this question

marked as duplicate by bodhi.zazen, Eliah Kagan, Basharat Sialvi, Eric Carvalho, Gilles Jul 17 '13 at 13:27

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2  
You edit / set your prompt in ~/.bashrc, there are several options. See the answer above as well as cyberciti.biz/tips/… You could also shorten your hostname. –  bodhi.zazen Jul 17 '13 at 3:45

2 Answers 2

up vote 2 down vote accepted

Run the following command in a terminal to open ~/.bashrc file:

gedit ~/.bashrc

When .bashrc opens, locate and uncomment force_color_prompt=yes (remove the hash, so it no longer looks like: #force_color_prompt=yes) and change the value of PS1 in something like:

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@<anything-you-want>\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '

More about: http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html

share|improve this answer

The second part after the @ is the name of your computer. Change it!
Change it in 2 places:
sudo gedit /etc/filename
Replace 'filename' first by 'hosts' and then by 'hostname'
then find "itachi-HP-Pavilion-g6-Notebook-PC" and change it to a desired name. Make sure that the name you choose is without spaces.
Save the file.

Restart the computer and you are done! Samjha?

share|improve this answer
    
Thanks for additional info :). It worked with the previous answer too. This is good info to know :). –  Lakshmi Narayanan Jul 18 '13 at 13:30

Not the answer you're looking for? Browse other questions tagged or ask your own question.