ormaaj 1629588612 learn Use `chattr +a ~/.bash_history` to set the append-only flag on the history file. This guards against potential loss of history lines, but prevents all write operations other than append, requires both OS and filesystem support, usually requires privileges, and the commands for setting and querying the attribute are nonstandard and OS dependent. https://mywiki.wooledge.org/BashFAQ/088#Using_extended_attributes