Editing the Command Line

When working at a command prompt, you often enter the same command several times, or enter several similar commands . If you make a mistake when typing a command line, you don't want to retype the whole thing—you just need to fix the part that was wrong. Windows includes a feature that recalls previous commands and allows you to edit them on the current command line. Table B-1 lists these editing keys and what they do.

Table B-1 Command-Line Editing Keys



Up Arrow

Recalls the previous command in the command history

Down Arrow

Recalls the next command in the command history

Page Up

Recalls the earliest command used in the session

Page Down

Recalls the most recent command used

Left Arrow

Moves left one character

Right Arrow

Moves right one character

Ctrl + Left Arrow

Moves left one word

Ctrl + Right Arrow

Moves right one word


Moves to the beginning of the line


Moves to the end of the line


Clears the current command


Displays the command history in a scrollable pop-up box


Displays commands that start with characters currently on the

command line


Clears the command history

The command-line recall feature maintains a history of the commands entered during the Command Prompt session . To display this history, press F7, which opens a window that shows your recently entered commands . Scroll through the history with the arrow keys, and then press Enter to reuse the selected command, or press the Left Arrow key to place the selected text on the command line without executing the command. (This allows you to edit the command before executing it.)

It's not necessary to display the pop-up window to use the command history. You can scroll through the history within the Command Prompt window with the Up Arrow and Down Arrow keys

The F8 key provides a useful alternative to the Up Arrow key. The Up Arrow key moves you through the command history to the top of the command buffer and then stops. F8 does the same, except that when you get to the top of the buffer, it cycles back to the bottom . Furthermore, F8 displays only commands in the buffer that begin with whatever you typed before you pressed F8 . Type d at the command prompt (don't press Enter), and then press F8 a few times. You'll cycle through recently entered commands that start with d, such as Dir and Del. Now type e (after the d), and press F8 a few more times . You'll cycle through Del commands along with any others that start with de. You can save a lot of keystrokes using F8 if you know the first letters of the command you're looking for.

Was this article helpful?

0 0
Digital Cancers

Digital Cancers

Get All The Support And Guidance You Need To Be A Success At Protecting Your PC. This Book Is One Of The Most Valuable Resources In The World When It Comes To The Damaging Facts About Computer Viruses.

Get My Free Ebook

Post a comment