Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have the opposite question to this. How do I keep all commands in bash history?

In Ubuntu since quite some time now, the default for bash is to forget commands with non success exit code. This is incredibly stupid and I would go with the accepted answer to linked question.

Unix user @goldilocks pointed out that maybe I am just confused by the ignoreboth directive.

set pastie

share|improve this question
3  
To me it looks like this is not the default to forget unsucessful commands in Ubuntu. What version are you using? Could you post a link to the output of the "set" command in pasebin or something so we could see what makes it delete the commands? –  David Kohen Dec 6 '12 at 10:25
    
@DavidKohen, added pastebin link. –  Prof. Falken Dec 6 '12 at 10:43
1  
The only thing I see in relation to history deletion is the fact that it ignores duplicates and lines that start with a space. Are you sure it ignores the failed commands? –  David Kohen Dec 6 '12 at 10:55
    
I was quite sure, but you make me doubt myself. It's not that way for "false". I will come back to this question and update it when annoyance strikes again. –  Prof. Falken Dec 6 '12 at 12:08
    
The 'this' and 'much prefer this' lead to the same place, which is a bit confusing... –  goldilocks Dec 6 '12 at 12:27

1 Answer 1

up vote 3 down vote accepted

I think you are confused because of HISTCONTROL=ignoreboth. See here: http://www.linuxjournal.com/content/using-bash-history-more-efficiently-histcontrol

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.