Red Hat Linux 7.1: The Official Red Hat Linux Getting Started Guide | ||
---|---|---|
Prev | Chapter 13. Frequently Asked Questions | Next |
What are some other ways I can use command history?
If you type history, you'll see a numbered list flash by, showing you the previous 500 commands you've used.
You probably don't 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'd typed will display (you can use any number with this command).
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.