Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

Can anyone explain the Ubuntu's bash prompt?

It's basically username@box:~$ but the part that confuses me is $. Is it just a letter that can be of preference, or it has some actual meaning?

share|improve this question

"$" was the default prompt string in sh, the Bourne shell. It doesn't have any special meaning besides showing that you are a normal user (the default prompt for root is "#").

Since bash ("Bourne Again" shell) is a derivative of sh, it continues to use $/# as part of its default prompt. Take a look at and bash's manual page for information on how to customize it.

share|improve this answer
In Mac OS X, the root account is also deactivated by default, but you can get a root shell with sudo -s (or sudo sh or whatever). Can't you do something similar in Ubuntu? So even with the root account disabled, having the prompt change from $ to # is useful for keeping track of whether or not you're in a superuser shell. – Spiff Feb 22 '11 at 6:07
@Spiff yeah that works, but the normal way is to use sudo. – Darokthar Feb 22 '11 at 7:13
It also changes for different shells. cshell/tcshell uses '%' not '$' – Rich Homolka Feb 22 '11 at 16:38

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.