Possible Duplicate:
Can history files be unified in bash?
I use Ubuntu Server 9.10 and I would like to be able to see my bash history for more than one terminal sessions. I.e. my last 200 commands or so, even if I have been logged out in between.
When I use the history I just see all commands from my actual terminal session. How can I see more command history from Bash? Is there any specific settings for bash that I should change from the default values in Ubuntu?
I don't have a ~/.bash_history file. But I have an ~/.bashrc with HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups and HISTCONTROL=ignoreboth
echo $HISTFILE
/home/sanoj/.bash_history
echo $HISTSIZE
500
echo $HISTFILESIZE
500
echo $HISTCONTROL
ignoreboth
UPDATE: I am now trying Ubuntu Server 10.10 in VirtualBox. If I just turn off VirtualBox without the shutdown command, then next time when I boot, the commands from the last session is not saved in the history file.
The commands are only saved if I shutdown the machine with the shutdown command. E.g. shutdown -P 0.
This must be the reason to my problem. So I have to figure out how to save the command-history more often. E.g. after each command.
echo $HISTSIZEandecho $HISTFILESIZE? My (Ubuntu)~/.bashrchas the sameHISTCONTROLlines as yours which is brain dead since the second one overrides the first and the values are supposed to be colon-separated, not comma-separated. If you doset -odoes it show a line that says "history on"? – Dennis Williamson Mar 18 '10 at 22:51500withechoon both variables andhistory on– Jonas Mar 18 '10 at 23:22