|
Enter the command: cd /class/sce/reference/unix/samples
Enter the command: ls
You should see the following files listed:
dummy.txt dummy1.cpp dummy1.txt dummy2.cpp dummy2.txt
Now enter the command ls *.cpp
Note that now only the files ending in .cpp are listed. In
the command above, you're telling ls to list only those files that
match your criteria i.e. files that end in .cpp.
Now enter the command: ls dummy1*
Observe that only the files starting with dummy1 are listed.
The shell interprets the "?" character as "any one character".
Enter the command: ls dummy?.*
In this case, the files listed are those starting with dummy,
followed by any one character, followed by a . (dot), followed by any number
of other characters.
|