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

Key

Function

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

Home

Moves to the beginning of the line

End

Moves to the end of the line

Esc

Clears the current command

F7

Displays the command history in a scrollable pop-up box

F8

Displays commands that start with characters currently on the

command line

Alt+F7

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
The Ultimate Computer Repair Guide

The Ultimate Computer Repair Guide

Read how to maintain and repair any desktop and laptop computer. This Ebook has articles with photos and videos that show detailed step by step pc repair and maintenance procedures. There are many links to online videos that explain how you can build, maintain, speed up, clean, and repair your computer yourself. Put the money that you were going to pay the PC Tech in your own pocket.

Get My Free Ebook


Post a comment