Tips on Using Command History


Question: 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 number might be useful. For example, using the command history 20 displays only the previous 20 commands you typed (you can use any quantity as an argument of the history command).

Here are other command history shortcuts that may be useful to you:

  • !! (called "bang bang") — Executes the last command in the history.

  • !number (as in !302) — Executes the command that is numbered 302 in the history file.

  • !string (as in !rpm) — Executes 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 forward through the commands) until you find the command you want. Press Enter to execute the command, just as if you had typed it on the command line.




The Red Hat Documentation Team - Official Red Hat Linux User's Guide
The Red Hat Documentation Team - Official Red Hat Linux User's Guide
ISBN: N/A
EAN: N/A
Year: 2002
Pages: 223

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net