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.

terminal

As you can see from the screenshot, my entire machine name (looks like a key) gets displayed whenever I invoke a terminal session.

Is there any way to avoid or hide it?

share|improve this question
    
Try something from this article ;) –  moon.musick Aug 28 '13 at 17:25

1 Answer 1

up vote 6 down vote accepted

Yes. Open ~/.bashrc file from terminal with:

gedit ~/.bashrc

Find this line (in my case is somewhere at line 60):

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '

and replace it with:

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '

As you can see, the most important thing is to delete \h (which stands for hostname) from PS1 if you want to hide machine name from displaying in terminal.

Save the file and close it. Restart the terminal, or just type:

. ~/.bashrc
share|improve this answer
    
\h means hostname, right? –  Braiam Aug 28 '13 at 22:44

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.