Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

I have an Ubuntu server that I administer through ssh. When I login as root I get a full path in the prompt, like /var/www. I created a user with sudo privileges for the purpose of administration. When I login, all I see in the command prompt is a $ sign. Is there a fix for this?

share|improve this question
Look inside root's /root/.bashrc file or the global /etc/bash.bashrc file to see the value of the PS1 variable for the root user and the system's defaults, respectively. – user13742 Feb 20 '12 at 16:30
up vote 8 down vote accepted

This is controlled by the PS1 environment variable. You can see what this is by running, as root, echo $PS1. You can then set the variable in your own bash profile with echo 'PS1=<value of PS1>' >> ~/.bashrc.

You can google for lots of possible values of PS1, but the part you are currently missing is \w for working directory.

share|improve this answer

If you see just $ as a prompt, it's most likely that you're running dash. Dash is a stripped-down shell with little more than POSIX standard features. It's intended to run scripts, and it's more efficient (both in terms of memory and in terms of processor speed) than bash. Dash doesn't have any fancy interactive feature. Under Ubuntu, /bin/sh is a symbolic link to dash.

If you intend to log in as that user interactively, I recommend changing your login shell to bash:

chsh -s bash
share|improve this answer
(+) or chsh -s /bin/bash worked for me. – capdragon Sep 22 '12 at 14:30

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.