bash history on reboot

This forum is for topics specific to the Raspberry Pi and Arch Linux ARM

bash history on reboot

Postby hendry » Fri Apr 25, 2014 1:45 am

If I run some commands and then reboot, the commands aren't in the ctrl+r history.

Am I missing something a trick?

Could it be that systemd is not exiting the shell in a graceful manner??
hendry
 
Posts: 40
Joined: Wed Jul 31, 2013 8:28 am
Location: Singapore

Re: bash history on reboot

Postby sdjf » Fri Apr 25, 2014 10:29 pm

If you change to a different subshell, the current bash history will be that one I think. I think it is less likely to be a matter of an unclean shutdown (unless you did not sync before rebooting) than of your being in a subshell whose history went away when you exited it.

One thing I have added to my bashrc files (I don't recall which offhand, might be the one that exits bash) is a routine that copies the old history to a .bak file and saves two prior histories automatically, so if my Pi crashes, I can manually restore an older bash_history.
sdjf
 
Posts: 178
Joined: Wed May 08, 2013 1:55 pm


Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 4 guests