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
link|improve this question
1  
This isn't a programming question – Chris Oct 10 '11 at 18:09
feedback

migrated from stackoverflow.com Oct 10 '11 at 18:11

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

2 Answers

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

PS1=\$

in your .profile

Otherwise use

PS1=$
link|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
feedback

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
link|improve this answer
feedback

Your Answer

 
or
required, but never shown