Results 1 to 5 of 5
Situation:
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 08-24-2004 #1Just Joined!
- Join Date
- Aug 2004
- Posts
- 2
bash history mystery
Situation:
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!
Thanks,
Tom
- 08-24-2004 #2Linux Guru
- Join Date
- Apr 2003
- Location
- London, UK
- Posts
- 3,284
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.
Jason
- 08-24-2004 #3Just Joined!
- Join Date
- Aug 2004
- Posts
- 2
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?
- 08-24-2004 #4Linux Guru
- Join Date
- Apr 2003
- Location
- London, UK
- Posts
- 3,284
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.
Jason
- 08-24-2004 #5


Reply With Quote
