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.

i'm new to ubuntu .presently i'm using ubuntu 12.04 version.I want to know how to change terminal's displaying text. currently my terminal displaying the text..

narasimha@narasimha:~$

how can i change it with narasimha@reddy:-$

share|improve this question

3 Answers 3

up vote 2 down vote accepted

All you really have to do is edit a system variable, $PS1, to be exact.

You would have to edit the ~/.bashrc file to make it permanent. Otherwise, it would only stay in effect until the user quit the terminal, then it would revert back.

Read here for a more in depth solution: http://www.linuxselfhelp.com/howtos/Bash-Prompt/Bash-Prompt-HOWTO-2.html

Quote:

It also supports configurable prompts - most people realize this, but don't know how much can be done

...

The appearance of the prompt is governed by the shell variable PS1.

You can either manually enter it this way, or follow what @Requist answered and use the sudo hostname reddy command and do it the easy way (we all like easy, right? :D)

share|improve this answer

Narashima is the hostname of the machine, you can alter is by issuing the command:

sudo hostname reddy

If you open a new shell it will read narasimha@reddy:-$

share|improve this answer
    
Thanks for your advice.i successfully changed it. –  Narasimha Reddy Dec 29 '13 at 19:31

It can be not possible, but there are 2 ways, don't know.

Case 1 (easier)

Make a new account "reddy" and look up the terminal. See if it works.

Case 2

Well, you might need a reinstall. When you install, in the username type reddy, and when you finally install the OS, make an account named "narasimha".

Case 2 is probably going to work, but I have no idea. Try the Case 1 first.

share|improve this answer
1  
Good, but it can be done easier with the $PS1 bash system variable. When the user set up his/her system, they set the hostname to narasimha as well as the username. Your solutions would set the prompt to reddy@narasimha-$. –  RPi_Awesomeness Dec 29 '13 at 19:22
    
I'm posting the easiest way, tbh I have no idea what are you talking about :P I am pretty positive that the asker will have no idea how to do it as well, because she's new to Ubuntu :) –  Xylo Dec 29 '13 at 19:25
3  
In any case, the part after the @ is the hostname, not the username - so creating a new account "reddy" would result in reddy@narasimha NOT narasimha@reddy –  steeldriver Dec 29 '13 at 19:25
    
Just said that :D –  RPi_Awesomeness Dec 29 '13 at 19:26
    
Yeah I'd think it would work that way, but I couldn't test it, as I'm not home. Whatever –  Xylo Dec 29 '13 at 19:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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