Quick Start Guide

FunctionWild Card
Matches exactly one arbitrary charac-
ter
?
Matches any number of characters
*
Matches one of the characters from
the group specied inside the square
[
set
]
brackets, which is represented here
by the string
set
.
17.6.1 Examples For Using History, Completion and Wildcards
The following examples illustrate how to make use of these convenient features of
Bash.
Procedure 17.6: Using History and Completion
If you already did the example Section 17.3.1, “Examples for Working with Files
and Directories” (page 197) your shell buer should be lled with commands which
you can retrieve using the history function.
1
Press [] repeatedly until cd ~ appears.
2 Press [Enter] to execute the command and to switch to your home directory.
By default, your home directory contains two subdirectories starting with the
same letter, Documents and Desktop.
3
Enter cd D and press [→|].
Nothing happens since Bash cannot identify to which one of the subdirectories
you want to change.
4 Press [→|] again to see the list of possible choices:
tux@knox:~> cd D Desktop/ Documents/ tux@knox:~> cd D
5 The prompt still shows your initial input. Type the next character of the subdi-
rectory you want to go to and press [→|] again.
Bash now completes the path.
6 You can now execute the command with [Enter].
206 Start-Up