Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




NOTE: CentOS Enterprise Linux is built from the Red Hat Enterprise Linux source code. Other than logo and name changes CentOS Enterprise Linux is compatible with the equivalent Red Hat version. This document applies equally to both Red Hat and CentOS Enterprise Linux.

14.8. Tips on Using Command History

What 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 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 are displayed (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) executes the command which is numbered 302 in the history file.

  • "Bang string": Typing !string (as in !rpm) executes a command with the most recent matching string from the history file.

  • [Up arrow] and [down arrow] KEYCAP" > [Enter] to execute the command, just as if you had typed it on the command line.

  Published under the terms of the GNU General Public License Design by Interspire