While using applications (such as a database front end, or a programming language) from within a terminal, what's the best way to store the command history (of commands issued within the applications).

E.g. I start python from the shell and issue a bunch of python commands. I'd like those stored somehow.

I know this is possible because I've done it earlier, but despite my best efforts, am unable to recall it now. It was something of the form >XX APP_NAME where APP_NAME was something like python and XX is the program that was prefixed to the application name to store the application's command history.

To clarify, when I go back in the same application the same way (> XX APP_NAME) pressing the up arrow should give previously issued commands.


Ok, found it at long last. It is rlwrap

To copy paste from its man page:

rlwrap runs the specified command, intercepting user input in order to provide readline's line editing, persistent history and completion

  • Awesome! I also used this before and needed it again. But it was very difficult to come up with the right search term. Finally found it! – Paul Sep 16 '20 at 9:45

screen > logfile

will make a full session logfile until exit

this keeps ALL

U can alos do script filename

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.