Managing System Files
File and Directory Management
OmniSwitch 6600 Family Switch Management Guide
April 2006
page 2-7
Using Wildcards
Wildcards allow you to substitute symbols (
*
or
?
) for text patterns while using file and directory
commands. The asterisk (
*
) takes the place of multiple characters and the question mark character (
?
)
takes the place of single characters. More than one wildcard can be used within a single text string.
Multiple Characters
An asterisk (
*
) is used as a wildcard for multiple characters in a text pattern. The following command lists
all entries in the current directory that end with the
.log
extension:
-> ls *.log
Listing Directory /flash:
-rw 64000 Sep 21 19:49 swlog1.log
-rw 64000 Aug 12 19:06 swlog2.log
The following command lists all entries in the current directory that contain the
i
character:
-> ls *i*
Listing Directory /flash:
drw 2048 Aug 21 17:49 certified/
drw 2048 Aug 12 18:51 working/
-rw 31 Jul 29 2001 policy.cfg
drw 2048 Jul 28 12:17 switch/
Single Characters
The question mark (
?
) is used as a wildcard for a single character in a text pattern. The following
command will locate all the entries containing
swlog
, followed by
any single character
, followed by the
.log
extension.
-> ls swlog?.log
Listing Directory /flash:
-rw 64000 Jul 21 19:49 swlog1.log
-rw 64000 Aug 12 19:06 swlog2.log
The single and multiple character wildcards can be used in combination. The following command lists all
entries containing the letter
i
followed by any two single characters:
-> ls *i??
Listing Directory /flash:
drw 2048 Aug 12 18:51 working/