I am working on a x86 target running fedora 9.

Whenever I reboot it, my history returns to some state, and I do not have commands I did in the sessions before the reboot.

What I have to change to have updated history I had before reboot?

link|improve this question
He is asking "How do I keep my bash history across sessions?", which is related to shell programming. The reboot is a dramatic way of losing your shell, that's all. It doesn't need closing off topic. – Jonathan Leffler Nov 17 '10 at 15:00
Good point—this probably should be moved to SuperUser. – B.R. Nov 17 '10 at 15:02
@Jonathan Yes, you got the question correct. I wasn't sure what exactly to ask. – VJo Nov 17 '10 at 16:02
feedback

migrated from stackoverflow.com Nov 17 '10 at 17:43

This question came from our site for professional and enthusiast programmers.

3 Answers

up vote 3 down vote accepted

Which history? bash-history? If you're losing bash history and you have multiple sessions at a time, it's because each session is overwriting the other sessions' history.

You probably want to tell bash to not overwrite the history each time, but rather to append to it. You can do this by modifying your .bashrc to run shopt -s histappend.

You can also increase the size of your history file by exporting HISTSIZE to be a large-ish number (it's in bytes, so 100000 should be plenty).

link|improve this answer
feedback

Look up the environment variables HISTFILE, HISTSIZE, HISTFILESIZE.

link|improve this answer
feedback

Good answer to this question is here:

http://linuxcommando.blogspot.com/2007/11/keeping-command-history-across-multiple.html

link|improve this answer
Welcome to SuperUser! Please include enough information in your answer that the asker doesn't have to click on an external link. Also, make sure your answer doesn't simply duplicate existing answers (which, from a quick glance at that link, it seems to be doing). – Indrek May 16 at 0:46
feedback

Your Answer

 
or
required, but never shown

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