I enter a command. It fails. I press arrow up, modify something and enter it again ... hold it right there.

It used to work like that. Now it's more like: I enter a command. It fails. I press arrow up, get the last command which didn't fail, likely "ls" or something useless and I type the whole thing again back by hand.

What happened? It wasn't always like this. But it's quite some time since this behavior changed, I'll give you that. Some years ago, at least. How do I put some sanity back into my bash prompt?

2 Answers 2


For my it still works as you describe it should, but maybe you need to look for something in the ~/.bashrc file that prevents some commands from showing up in the history, maybe something as described in here: http://blog.dhampir.no/content/avoiding-invalid-commands-in-bash-history


It does keep commands in the history regardless of exit status.

Check the value of HISTIGNORE: set | grep HISTIGNORE

I thought I was going crazy when I was purposely testing some failed commands, but they were not showing up in history. Then I realized I had HISTIGNORE="?:??", which ignores 1 and 2 letter commands (I was testing 2 letter commands).

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.