1

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

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 Nov 3 '15 at 7:19
  • 1
    Make your ~/.bash_profile do the loading. – user1686 Nov 3 '15 at 7:20
  • Sorry I am not familiar with ubuntu. Do you mean cp .bashrc .bash_profile? – Helend Nov 3 '15 at 7:21
  • 1
    I mean "add the 'source…' command to that file". – user1686 Nov 3 '15 at 7:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.