Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 stackoverflow.com Oct 10 '11 at 18:11

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

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

2 Answers 2

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

PS1=\$

in your .profile

Otherwise use

PS1=$
share|improve this answer
1  
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:

PS1=$ 

Then, run this:

source /etc/bashrc

Or:

source ~/bashrc
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.