Novell LINUX ENTERPRISE SERVER 10 - INSTALLATION AND ADMINISTRATION 11-05-2007 Installation Manual page 357

Table of Contents

Advertisement

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

Advertisement

Table of Contents
loading

This manual is also suitable for:

Suse linux enterprise server 10

Table of Contents