2

I want to get my bash command history as many as possible, I find ./bash_history only contains most recent two thousands lines, does it mean the ones before that is lost forever? Is there anyway to get it back.

Thanks a lot. Roy987

Roy987
  • 23
  • 2
  • 2
    That value depends on the value set in `HISTFILESIZE` along with values of other environment variables (i.e. HISTSIZE, ...). – CRM May 27 '12 at 03:01

1 Answers1

5

I'm afraid your past history is lost forever. But you can preserve it in the future. Increasing $HISTSIZE and $HISTFILESIZE helps, but if you really want to keep all your commands forever, check out this tip.

Mark Reed
  • 91,912
  • 16
  • 138
  • 175
  • +1 Very nice tip! See also my answers [here](http://stackoverflow.com/questions/945288/saving-current-directory-to-bash-history) for ways to save even more detail. – Dennis Williamson May 27 '12 at 10:54