0

I am using Putty as Terminal to connect a Linux server running Oracle Linux. To use a command multiple times, I have to type that command each time. There is no function of Up and Down button unlike using Telnet from DOS command prompt.

Retyping longer commands or statements create problems. To overcome from this problem, I want to re-execute a command without retyping and use the Up and Down buttons.

  • Is there any command which need to be executed to enrich the terminal with this functionality?
  • 2
    Linux default shell(bash) supports Up and Down arrows to redo commands. The same way you can search through your commands using the Control+r combination and typing a piece of the command you already executed.This is called reverse-search. This could be just a matter of configuring putty or the shell you are using on Linux. Those and other shell features long stand on Linux and BSD ecosystems. – user34720 Apr 7 '15 at 13:51
  • Most Linux installations have working command history (that's the name of the feature you're asking for) by default. Your setup is weird. How is the account you're connecting to configured? What is the output of ps uww $$; echo $TERM and what appears when you press Ctrl+V then Up? What happens when you press Ctrl+P? – Gilles Apr 7 '15 at 22:32
  • $ psuww $$ psuww: not found – ursitesion Apr 7 '15 at 23:40
  • $ echo $TERM xterm Ctrl+V then Up -> $ ^[[A – ursitesion Apr 7 '15 at 23:43
1

If you're asking asking how to add command history to a program that doesn't support it, then use rlwrap.

  • Would you mind give your experience and some more details about rlwrap? – Mohammad Etemaddar Jun 15 '15 at 3:34
  • @Mohammed I've never used it. I just know it exists. – Functino Jun 15 '15 at 20:28

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.