Many times you will find yourself using the same command multiple times.
Instead of constantly typing the same command over and over, Windows command history editor provides quick access to a list of recently executed commands.
There are several ways to recall a command from history either to execute the command again, edit it by adding addition arguments or changing to different directories. But first let's set the buffer that will determine the number of commands that can be stored.
To do this, click on Start \ Run… and type cmd for Wndows XP.
Or for Windows Vista and Windows 7, click Start and type cmd in the search box, then click cmd.exe in the search list.
When command shell window opens, click once on the command shell logo in the top left corner of the window and select properties.
Once the properties window opens, in the Command History section, you can leave the setting at their default values on change it to make the Buffer Size bigger (you can leave the Numbers of Buffers at 4). Also check the Discard Old Duplicates. This will delete any duplicate commands in the history buffer. When finished click OK.
You may also want to check the Quick Edit Mode under Edit Options which will enable cut and paste at the command prompt.
After you have begun to use commands and you need to recall a command from history, one method is to press F7. This will open a window listing all the command, in order, you have used during the session.
To navigate and select a command, use the up / down arrow keys and press enter to select and immediately execute the command or use the left / right arrow keys to select a command which can be edited at the prompt. The Esc key closes the window without selecting a command.
If the history buffer has many commands, use the Pg Up / Pg Dn keys to jump ahead or back through the buffer.
Another method to recall from the history can be performed at the command prompt itself. Press either the up or down arrow keys, to scroll through the buffer or use Pg Up and move to the oldest command and Pg Dn moves to the newest command.
The F8 searches the buffer by first typing a few characters of the command and pressing F8. The most recent command to match the search will display. Repeatedly pressing F8 will continue the search for the next search match.
Using the F9 key will recall commands by their number. A popup window will appear allowing you to enter the number of the command previously executed.
You can also type the first letter of a command at the prompt, then use the right arrow key to continue to spell out the most recently used command. This is usefull if their were syntex errors that need to be edited.
Windows command prompt provides a powerful tool to manage your System. Knowing the tricks when using the shell makes Administration a lot easy and fun.
Know of any command prompt tricks? Tell us a trick or two and we'll we'll publish them with your name attached to them!