How can I see all of the bash history?

diveintohacking picture diveintohacking · Feb 27, 2013 · Viewed 73.8k times · Source

First let me show an example below.

In shell(1) I did the following command.

$ ping google.com
PING google.com (74.125.235.164) 56(84) bytes of data.
64 bytes from nrt19s12-in-f4.1e100.net (74.125.235.164): icmp_seq=1 ttl=54 time=2.85 ms
64 bytes from nrt19s12-in-f4.1e100.net (74.125.235.164): icmp_seq=2 ttl=54 time=3.42 ms

And after that, open another shell(2) and look at history.

$ history
 .
 .
 .
 8720  exit
 8721  clear
 8722  history

In this case, the shell can not see the history executed by shell(1), but I want to see all of the bash history in every shell.

So my question is how can I see all of the bash history? Does anybody know how to hack?

Thank you very much in advance!

Answer

etusm picture etusm · Oct 2, 2015
cat ~/.bash_history

would also work, although I tend to just use

vim ~/.bash_history 

and then use /to search