Results 1 to 4 of 4
Dear All,
How can I indicate a number is 1 or 2? I have tried to find it from the textbook but it doesn't match to the answer. I only ...
- 11-16-2010 #1Just Joined!
- Join Date
- Nov 2010
- Posts
- 3
Using wildcard metacharacters, how can you indicate a number is 1 or 2?
Dear All,
How can I indicate a number is 1 or 2? I have tried to find it from the textbook but it doesn't match to the answer. I only get the following stuff:
These characters can simplify commands that specify more than one filename on the comand line, as you saw with the file command earlier. These wildcard metacharacters are interpreted by the shell and can be used with most comon Linux filesystem commands.
Could you help me?
- 11-16-2010 #2
Try here ... search for wild card
- 11-17-2010 #3Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,970
I assume you refer to wildcards in a command-line interface? Here is an example:
Is this what you are trying to figure out?Code:# The following line will output all files in local directory that have the # numbers 1 or two in their names. # The brace around the numbers indicates that the name must match # either a 1 or a 2 anywhere in the name. echo *[12]* # This will match names with any number from 0 thru 9 in the name. echo *[0-9]* # This will match names with 1 or 2 followed by any other number. echo *[12][0-9]*
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 11-17-2010 #4Just Joined!
- Join Date
- Nov 2010
- Posts
- 3
Thank you for all your help.
Cheers,


Reply With Quote