As we discovered in Chapter 1,
bash maintains a history of commands that have been entered. This list of commands is kept in your home directory in a file called .bash_history. The history facility is a useful resource for reducing the amount of typing you have to do, especially when combined with command-line editing.
At any time, we can view the contents of the history list:
history | less
bash stores the last 500 commands you have entered. We will see how to adjust this value in Chapter 11. Let’s say we want to find the commands we used to list /usr/bin. Here is one way we could do this:
history | grep /usr/bin
And let’s say that among our results we got a line containing ...