This runs the most recent command that
contains a particular string of characters. For example, you can run the date command
again by just searching for part of that command line as follows:
$ !?dat?
date
Thu Oct 26 21:32:41 PDT 2008
Instead of just running a history command line immediately, you can recall a particular line and
edit it. You can use the following keys or key combinations to do that, as shown in Table 2-4.
TABLE 2-4
Keystrokes for Using Command History
Key(s) Function Name Description
Arrow Keys (?†‘ and ?†“) Step Press the up and down arrow keys to step through
each command line in your history list to arrive at
the one you want. (Ctrl+P and Ctrl+N do the same
functions, respectively.)
Ctrl+R Reverse Incremental Search After you press these keys, you enter a search string
to do a reverse search. As you type the string, a
matching command line appears that you can run
or edit.
Ctrl+S Forward Incremental Search Same as the preceding function but for a forward
search.
Alt+P Reverse Search After you press these keys, you enter a string to do a
reverse search. Type a string and press Enter to see
the most recent command line that includes that
string.
Alt+N Forward Search Same as the preceding function but for a forward
search.
Pages:
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196