views:

117

answers:

1

Hi when i start putty on a server i get the promp like below:

hpbl802!benjaminb:~ [22]>

How can i change this prompt to

benjamin:~ [22]>
+5  A: 

It's not Putty, it's your shell that gives you the prompt. If you are using bash, try:

PS1='benjamin:\w [\!]> '
export PS1

If that works, you can add the two lines to your $HOME/.bashrc on the server.

More information on bash prompts.

If your shell is not bash, you need to tell us what shell it is. The easiest way is to type a non-existent command on the command-line:

$ 42
-bash: 42: command not found

The above tells me that my shell is bash.

Alok
Instead of hard-coding "benjamin", it's better to use `\u` which pulls in the username.
Dennis Williamson
@Dennis: I would have suggested `\u`, but didn't because his username seems to be `benjaminb` and he wants `benjamin`.
Alok