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.

How can I change prompt name seen at terminal ?

my prompt :

<user_name>@<user_name>-MEGA-BOOK-VR320:~$

It is too long. I want to change it as :

gcc : 

However, I should see path when I have go from one directory to another.

gcc :~$ cd X_directory
gcc :~/X_directory$

How can I do that, permanently ?

share|improve this question

2 Answers 2

up vote 5 down vote accepted

Test it with this:

export PS1="gcc :\w\$ "

If if its what you want, then change it in your .bashrc file:

gksu gedit .bashrc

delete or comment out this line:

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

and replace with

PS1='gcc :\w\$ '
  • note if your username is "gcc" then you could replace gcc with \u

Hope that helps. More info on PS1 here.

share|improve this answer
  1. First, open a terminal and type:

    root@penreturns:~$ gksu gedit /etc/hostname

You should see a line stating your current hostname. For eg. iPad

  1. Change the hostname to something you desired. Save and close the file.

  2. Back in your terminal, type:

    root@penreturns:~$ gksu gedit /etc/hosts

  3. Change the line:

127.0.1.1 iPad

to

127.0.1.1 your-new-hostname

Save and close the file.

Reboot and your new hostname should appear in the terminal now.

*copy code without root@penreturns:~$

http://penreturns.rc.my/2012/02/how-to-change-your-hostname-ubuntu.html

share|improve this answer
    
Does this requirement (and question) really justify changing the hostname? –  david6 Jun 19 '12 at 9:34
    
for this " <user_name>@<user_name>-MEGA-BOOK-VR320:~$ " my answer is yes –  penreturns Jun 19 '12 at 9:36

Your Answer

 
discard

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