bash doesn't keep history

It could also be that root:root owns your .bash_history (ROOT SHOULDN'T BE THE OWNER, YOUR USER SHOULD BE THE OWNER!), in that case you need to:

$ chown user:user .bash_history

This apparently could happen magically when you do sudo bash a lot!


Assuming you're using gnome-terminal??, if so maybe check the permissions on .bash_history. It should be -rw-r--r--

To do so in a terminal ls -la |grep .bash, all 3 files should have the above permissions. Otherwise try deleting .bash_history, restart & see if a history is then written

Note that the history is only written once the terminal is closed or quit.

Tags:

Bash

History