Super User is a question and answer site for computer enthusiasts and power users. 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 want to hide username@solaris in a Unix shell.

I would like something like this:

$ ls -l

Instead I have this:

user@solaris:~$ ls -l
share|improve this question

migrated from Oct 10 '11 at 18:11

This question came from our site for professional and enthusiast programmers.

This isn't a programming question – Chris Oct 10 '11 at 18:09

If by "something like" you mean: '$' when normal user, '#' when root then put


in your .profile

Otherwise use

share|improve this answer
This makes a good point. You should use different prompts for root vs other users like CharString suggests. – chown Oct 10 '11 at 18:19

In /etc/bashrc or ~/.bashrc change the PS1 environment variable to PS1=$. Or add a new line if no PS1 already exists with:


Then, run this:

source /etc/bashrc


source ~/bashrc
share|improve this answer

You must log in to answer this question.