Frantisek Hanzlik wrote:
And more - at several important machines when I want reboot them, I press for logging off and then login on for this only "shutdown -r now" command. And by then I at these machines not observed problems with bash history. Maybe it is speculation, but seem for me as systemd causation.
I have noticed that when I shut a computer down using the command line, systemd will kill any open bash sessions before they get a chance to save the history to ~/.bash_history.
If this seriously bothers you, you could investigate the history command, and possibly put it into the PROMPT_COMMAND environment variable so the history is written to disk each time the shell shows a new prompt.
Hope this helps,
James.