Difference between a root and non-root shell prompt

Have you ever looked at the command prompt carefully? Exactly! we usually don't care about the prompt. All we see is the little symbol at the end designating the prompt(usually its “$”) or at most look at the current working directory. This way sometimes we might not realize its actually a root prompt. This happens a lot when you are working at multiple terminals. So, in order to prevent a big mistake from happening, the super-user or root’s prompt ends with a “#”, instead of “$” in case of a non-root user.

Now you know the significance of a single character .

7 Comments

Anon Linuxer (not verified)
January 14th, 2011 09:26 pm
Why would you 'sudo su' and not just do 'su'?
January 14th, 2011 09:34 pm

I hardly ever login as root on debian systems. So, I don't think I ever set any passwd for root. The one I remembered was my own(user "sahni") so went for "sudo su".

Anon Linuxer (not verified)
January 14th, 2011 09:59 pm
Ubuntu doesn't like the user changing things, which is why Mark Shuttleworth likes to spoonfeed gui tools for pointless tasks lol. Root account is the most important thing on a box, ubuntu should realise that and NOT disable it as a login-account.
Anon Linuxer (not verified)
January 14th, 2011 11:42 pm
Because with sudu you just use your password, and not the root password (in Ubuntu and some other linux distros is not set by default)
Mark (not verified)
January 14th, 2011 09:50 pm
I was hoping to see an explanation of why the symbols '$' and '#' are used, not what they are used for.
January 15th, 2011 12:28 am

There are other commons characters too - ">", "%" and ":". I don't think there is any historic significance related to their usage but if I had to guess, "$" probably became popular from the earlier unix shell "sh". Try "sh" or "/bin/sh" on your shell.

Anon Linuxer (not verified)
January 15th, 2011 01:38 am
Yeh it depends on the shell in use. Bash / Dash typically uses a "$" to denote a user account, while "#" means administrator or 'root'. With shells such as csh ans zsh the default user prompt is a "%". It doesn't really matter what is used, i guess it is user-preference. But the "#" tends to mean root.

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <img> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <h1> <h2> <h3> <h4> <h5> <h6> <p> <br>
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Image links with 'rel="lightbox"' in the <a> tag will appear in a Lightbox when clicked on.
  • Search Engines will index and follow ONLY links to allowed domains.

More information about formatting options

Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.