bash history mystery
I am logged in remotely to a RedHat server via SSH and I have gone in directly as root.
I have entered 30+ commands within the past 10 minutes at the command line.
The ouptput of this command "echo $HISTFILE" is /root/.bash_history.
The last 30+ commands are not in /root/.bash_history.
The output of this command "fc -l 30" *DOES* show my last 30 commands.
Where in heck are my most recent commands being stored? Where did "fc -l" find them? Why are they not in my .bash_history file?
Smiley face to the first person who answers!
Commands get written to the bash_history when you type "exit" to logout.
If you want to get back to one command recently typed without logging out, use the UP arrow key.
I appreciate the reply and, just after I posted this quesiton, I discovered that the history gets written to .bash_history after you exit the shell.
The question is still open, however: where are those commands before they get written? Where is the command history (via up arrow or "fc -l") coming from?
Most likely a list in RAM, the only way to know for sure would be to open up the source code for bash, but im fairly certain its in memory.
as near as i know it is stored in ram within the program. i dont think it can be activly written to a file.