Ubuntu – How to change the prompt of the terminal permanently

command linepromptps1

How can I change prompt name seen at terminal?

my prompt :


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

gcc : 

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

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

How can I do that, permanently?

Best Answer

Test it with this:

export PS1="gcc :\w\$ "

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

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.

Related Question