
17.1.4 Useful Features of the Shell
Entering commands in Bash can include a lot of typing. In the following, get to know
some features of the Bash that can make your work a lot easier and save a lot of typing.
History and Completion
By default, Bash “remembers” commands you have entered. This feature is called his-
tory. To repeat a command that has been entered before, press
↑
until the desired com-
mand appears at the prompt. Press
↓
to move forward through the list of previously
entered commands. Use
Ctrl
+
R
to search in the history.
You can edit the selected command, for example, changing the name of a file, before
you execute the command by pressing
Enter
. To edit the command line, just move the
cursor to the desired position using the arrow keys and start typing.
Completing a filename or directory name to its full length after typing its first letters
is another helpful feature of Bash. To do so, type the first letters then press
→|
. If the
filename or path can be uniquely identified, it is completed at once and the cursor moves
to the end of the filename. You can then enter the next option of the command, if nec-
essary. If the filename or path cannot be uniquely identified (because there are several
filenames starting with the same letters), the filename or path is only completed up to
the point where again several options are possible. You can then obtain a list of them
by pressing
→|
a second time. After this, you can enter the next letters of the file or
path then try completion again by pressing
→|
. When completing filenames and paths
with the help of
→|
, you can simultaneously check whether the file or path you want
to enter really exists (and you can be sure of getting the spelling right).
Wild Cards
Another convenience offered by the shell is wild cards for pathname expansion. Wild
cards are characters that can stand for other characters. There are three different types
of these in Bash:
?
Matches exactly one arbitrary character
*
Matches any number of characters
Working with the Shell
339
Summary of Contents for LINUX ENTERPRISE SERVER 10 - INSTALLATION AND ADMINISTRATION 11-05-2007
Page 1: ...SUSE Linux Enterprise Server www novell com 10 May 11 2007 Installation and Administration...
Page 14: ......
Page 19: ...Part I Deployment...
Page 20: ......
Page 60: ......
Page 128: ......
Page 243: ...Part II Administration...
Page 244: ......
Page 274: ......
Page 312: ......
Page 348: ......
Page 380: ......
Page 381: ...Part III System...
Page 382: ......
Page 438: ......
Page 452: ......
Page 478: ......
Page 486: ......
Page 498: ......
Page 512: ......
Page 558: ......
Page 559: ...Part IV Services...
Page 560: ......
Page 652: ......
Page 670: ......
Page 742: ......
Page 754: ......
Page 796: ......
Page 817: ...Part V Security...
Page 818: ......
Page 858: ......
Page 886: ......
Page 910: ......
Page 911: ...Part VI Troubleshooting...
Page 912: ......
Page 924: ......