Operation Manual
Completion
Completing a lename or directory name to its full length after typing its rst letters
is another helpful feature of Bash. To do so, type the rst letters then press →|
(Tabulator). If the lename or path can be uniquely identied, it is completed at
once and the cursor moves to the end of the lename. You can then enter the next
option of the command, if necessary. If the lename or path cannot be uniquely
identied (because there are several lenames starting with the same letters), the
lename or path is only completed up to the point where it becomes ambiguous
again. You can then obtain a list of them by pressing →| a second time. After this,
you can enter the next letters of the le or path then try completion again by
pressing →|. When completing lenames and paths with the help of →|, you can
simultaneously check whether the le or path you want to enter really exists (and
you can be sure of getting the spelling right).
Wild Cards
You can replace one or more characters in a lename with a wild card for pathname
expansion. Wild cards are characters that can stand for other characters. There are
three different types of these in Bash:
FunctionWild Card
Matches exactly one arbitrary character
?
Matches any number of characters
*
Matches one of the characters from the group specied
inside the square brackets, which is represented here by
the string set.
[set]
21.6.1 Examples For Using History,
Completion and Wildcards
The following examples illustrate how to make use of these convenient features of
Bash.
Shell Basics 317