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 :


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
add comment

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
add comment
  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: iPad

to your-new-hostname

Save and close the file.

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

*copy code without root@penreturns:~$


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
add comment

Your Answer


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.