Now, suppose you want to change
/usr/bin to /bin. You can use the following steps to change the command:
1. Press the up arrow to recall the line.
2. Press Ctrl+A. This moves the cursor to the beginning of the command line.
3. Press Ctrl+F or the right arrow (?†’) key. Repeat this command a few times to position the
cursor under the first slash (/).
4. Press Ctrl+D. Type this command four times to delete /usr from the line.
5. Press Enter. This executes the command line.
As you edit a command line, at any point you can type regular characters to add those characters
to the command line. The characters appear at the location of your cursor. You can use right (?†’)
and left (?†?) arrow keys to move the cursor from one end to the other on the command line. You
can also press the up (?†‘) and down (?†“) arrow keys to step through previous commands in the history
list to select a command line for editing. (See the discussion on command recall for details on
how to recall commands from the history list.)
TIP
49
Running Commands from the Shell 2
There are many keystrokes you can use to edit your command lines. Table 2-1 lists the keystrokes
that you can use to move around the command line.
TABLE 2-1
Keystrokes for Navigating Command Lines
Keystroke Full Name Meaning
Ctrl+F Character forward Go forward one character.
Pages:
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191