If a command resides in several locations, you can add the -a option to have all the
known locations of the command printed.
Sometimes you run a command and receive an error message that the command was
not found or that permission to run the command was denied. In the first case, check
that you spelled the command correctly and that it is located in your PATH variable. In the second
case, the command may be in the PATH variable, but may not be executable. Adding execute permissions
to a command is described later in this chapter.
Rerunning Commands
After typing a long or complex command line, it??™s annoying to learn that you mistyped something.
Fortunately, some shell features let you recall previous command lines, edit those lines, or complete
a partially typed command line.
The shell history is a list of the commands that you have entered before. Using the history command
in a bash shell, you can view your previous commands. Then, using various shell features,
you can recall individual command lines from that list and change them however you please.
The rest of this section describes how to do command-line editing, how to complete parts of command
lines, and how to recall and work with the history list.
TIP
48
Linux First Steps Part I
Command-Line Editing
If you type something wrong on a command line, the bash shell ensures that you don??™t have to
delete the entire line and start over.
Pages:
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189