How can I see all of the bash history? How can I see all of the bash history? shell shell

How can I see all of the bash history?


cat ~/.bash_history

would also work, although I tend to just use

vim ~/.bash_history 

and then use /to search


You should look into the histappend shell option and the -a flag to history:

histappend

If set, the history list is appended to the file named by the value of the HISTFILE variable when the shell exits, rather than overwriting the file.

history

-a Append the "new" history lines (history lines entered since the beginning of the current bash session) to the history file.

If you put history -a into your PROMPT_COMMAND, you'll get an always-up-to-date .bash_history file.


try this:

Edit your .bashrc and append this to it's end:

shopt -s histappendPROMPT_COMMAND="history -n; history -a"unset HISTFILESIZEHISTSIZE=2000

source: http://subbass.blogspot.com.br/2009/10/howto-sync-bash-history-between.html