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

My root and admin user both have the same .bashrc file.

The prompt section of the .bashrc is the following:

         if [ "$color_prompt" = yes ]; then
                PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' 
                PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' 
         unset color_prompt force_color_prompt

         # If this is an xterm set the title to user@host:dir 
         case "$TERM" in xterm*|rxvt*)
                PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"

But the problem is that the admin user and root user have different prompts.

admin's prompt is:


and root's prompt is


So it seems root is using the "xterm" version and admin is not.

Why does the .bashrc file have this difference in prompts? How do I get the admin user to also use the xterm version?

How would I test that condition?

If I run echo $TERM while running as the admin user I get xterm so as far as I can tell, it should be using the xterm version for the admin user.

share|improve this question
up vote 3 down vote accepted

It works as expected.

By convention, the prompt ends with $ for users and by # for root. This is the \$ in PS1.

The other difference is the ~ vs /home. This is also normal. It is the \w part of the prompt, the current working path. If it begins with the content of $HOME, it is replaced by ~.

share|improve this answer
thank you, settles it. – Michael Wiles Mar 4 '11 at 9:15

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.