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 :
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 ?
First, open a terminal and type:
root@penreturns:~$ gksu gedit /etc/hostname
You should see a line stating your current hostname. For eg. iPad
Change the hostname to something you desired. Save and close the file.
Back in your terminal, type:
root@penreturns:~$ gksu gedit /etc/hosts
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:~$
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:
and replace with
PS1='gcc :\w\$ '
Hope that helps. More info on PS1 here.