128 Chapter 14. Frequently Asked Questions14.7. Finding Commands QuicklyI was looking at a man page yesterday, but I cannot remember the name of the command I was readingabout, and I did not write it down. How do I get the man page back?The command you used is stored in a file called .bash_history. By default, this file records the last500 commands you typed at the shell prompt.You can glimpse the history of your commands by typing history at the shell prompt, but the resultsare displayed too quickly for you to read every line.Another way to view .bash_history is with a utility such as less. Type less .bash_historyat the shell prompt and the results will display one page at a time. To move forward a screen, pressthe [Space] bar; to move back a screen, press the [b] key, and to quit, press [q].Paging through .bash_history to find a command can be tedious. Alternatively, you can searchthrough the file for keywords using grep, a powerful search utility.Say you were reading the man page the day before, but cannot recall its name. To search for thecommand, type:history | grep manAll the commands you typed which have the word man in them are now highlighted.There are many ways to use your command history. For other tips and tricks, seeSection 14.8 Tips on Using Command History.14.8. Tips on Using Command HistoryWhat are some other ways I can use command history?If you type history, a numbered list scrolls by very quickly, showing you the previous 500 com-mands you have used.You probably do not need to see all of the last 500 commands, so the command history 20 mightbe useful. This way, only the previous 20 commands you typed are displayed (you can use any quantityas an argument of the history command).14.8.1. Other ShortcutsHere are other command history shortcuts which may be useful to you:• "Bang, bang": Typing !! (called "bang bang") executes the last command in the history.• "Bang number": Typing !number (as in !302) executes the command which is numbered 302 inthe history file.• "Bang string": Typing !string (as in !rpm) executes a command with the most recent match-ing string from the history file.• [Up arrow] and [down arrow]: At the shell or GUI terminal prompt, you can press the up arrowto move back through previous commands in your history list (the down arrow moves you for-ward through the commands) until you find the command you want. Press [Enter] to execute thecommand, just as if you had typed it on the command line.