Following this question here: Show only current directory name (not full path) on bash prompt.

I have the same problem which would like to hide the whole path to the current directory (only show the current folder line) in the putty command line. It is annoying when I'm in the long directory tree.

The answer in that question is not working for putty connected from Windows machine. How should I configure my putty?

Thanks for any suggestions.

1 Answer 1


This has nothing to do with PuTTY; it does not have its own command line – it is a SSH client, working much like Telnet or Remote Desktop, but all text is still shown by your usual shell.

If the given configuration for bash doesn't work, one possible answer is you're not using bash. Take a look at echo $SHELL, printenv SHELL, or ps $$ to find out what command interpreter is actually being used. (Pretty much all of them have different configuration files.)

If you are using bash, the other answer is that you've put your configuration in the wrong place. First test it directly within the command line, by running PS1=">" or something such. Then reconnect and try manually loading the config files using source ~/.bashrc and such. Pay attention to any error messages that might show up.

  • Thanks for your suggestions. it is working for me. But I have to manually load ~/.bashrc after reconnecting. How do I automatically load them? My OS is ubuntu 12.04.
    – Helend
    Commented Nov 3, 2015 at 7:19
  • 1
    Make your ~/.bash_profile do the loading. Commented Nov 3, 2015 at 7:20
  • Sorry I am not familiar with ubuntu. Do you mean cp .bashrc .bash_profile?
    – Helend
    Commented Nov 3, 2015 at 7:21
  • 1
    I mean "add the 'source…' command to that file". Commented Nov 3, 2015 at 7:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .