Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


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
up vote 7 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
@Braiam yes, as well as \u means username. – amertkara Sep 10 '15 at 18:58

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.