Search code examples
unixshellprompt

How to change the prompt in putty


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]>

Solution

  • 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.