3

when I use copy and paste to run a command, and later I want to run the command again it doesn't appear in history.

Sometimes if I paste and then change some of the arguments the command does appear in the history.

How can I make sure that all the commands that I run appear in history?

  • 1
    If you paste a command with a leading space, they do not appear in history. Check this. – A.B. Jul 13 '15 at 14:20
  • 1
    To change this behavior, check the manpage and look for HISTCONTROL. For exmaple, export HISTCONTROL="" in .bashrc would do the trick. – Jeff Learman Aug 7 '18 at 0:13
6

If you paste a command with a leading space, they do not appear in history. Such a thing can easily happen if you copy and paste commands (eg. from websites or documents)

  • Exactly what I just wanted to type... You're too fast! ;) – Byte Commander Jul 13 '15 at 14:24
  • @ByteCommander sorry, you need answers, I know. =\ – A.B. Jul 13 '15 at 14:24
  • @user844541: If you like the answer, just click the little grey under the "0" now turning it into beautiful green. If you do not like the answer, click on the little grey down-arrow below the 0, and if you really like the answer, click on the little grey checkmark and the little up-arrow... If you have any further questions, go to askubuntu.com/questions/ask – Fabby Jul 14 '15 at 8:11

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.