Installation guide
Chapter 14. Frequently Asked Questions 139
history | grep man
You will see a list of all the commands you typed which have the word man in them.
There are plenty of ways to your command history. For other tips and tricks, see Section 14.8.
14.7. Keep ls Output from Scrolling
Whenever I type ls I can barely see the output of the directory because it scrolls by too quickly. How
can I actually read the output?
To prevent the output of ls from scrolling by too quickly, pipe the output to a utility such as less or
more. You will then be able to see the output one screen, or "page" at at time.
To read the contents of /etc with less, type the following command at the shell prompt:
ls -al /etc | less
To move forward a screen, press [Space] bar; to move back a screen, press the [b] key; to quit, press
[q].
You can achieve the same results with more, another paging utility.
14.7.1. Printing ls Output
You can also print directory listings by piping the output to a printer in the same way that you piped
the output to your screen. If you have configured a printer, type the following to pipe the output of a
command to the printer:
ls -al /etc | lpr
14.8. Tips on Using Command History
What are some other ways I can use command history?
If you type history, you will see a numbered list scroll by very quickly, showing you the previous
500 commands you have used.
You probably do not need to see all of the last 500 commands, so the command history 20 might
be useful. This way, only the previous 20 commands you typed will display (you can use any quantity
as an argument of the history command).
14.8.1. Other Shortcuts
Here 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) will execute the command which is numbered 302
in the history file.
• "Bang string": Typing !string (as in !rpm) will execute a command with the most recent
matching string from the history file.
• [Up arrow] and[ down arrow]: At the shell or GUI terminal prompt, you can simply press the up
arrow to move back through previous commands in your history list (the down arrow will move you