How can I hide username@node in linux shell?

3

1

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

tulkas85

Posted 2011-10-10T18:08:07.257

Reputation: 131

1This isn't a programming question – Chris Eberle – 2011-10-10T18:09:48.387

Answers

9

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

PS1=\$

in your .profile

Otherwise use

PS1=$

Chris Wesseling

Posted 2011-10-10T18:08:07.257

Reputation: 301

1This makes a good point. You should use different prompts for root vs other users like CharString suggests. – chown – 2011-10-10T18:19:18.743

6

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

chown

Posted 2011-10-10T18:08:07.257

Reputation: 1 679