If I type in a command it is preserved in history, but If I copy and paste a command from other place it is not preserved in history which is annoying if I have to run it again.

I think this happens whatever working environment I'm in, but currently in case it makes a difference I;m connecting to a remote Ubuntu machine via Putty on a Windows machine, and pasting commands from a text document on Windows.


There should be no difference between a copy-and-pasted command and a typed one. However, if you start a command line with a space, that command is not saved into the history. It's quite easy when copying and pasting to accidentally put a space at the beginning.

  • Thanks I think youve cracked it, my commands are in a text file and indented for readability so often there is a leading space or two. – Paul Taylor Nov 26 '15 at 12:06

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.