65Chapter 2Running Commands from (Professional web hosting) the ShellTry out some
65Chapter 2Running Commands from the ShellTry out some of these file-matching metacharacters by first going to an empty direc- tory (such as the testdirectory described in the previous section) and creatingsome empty files: $ touch apple banana grape grapefruit watermelonThe touchcommand creates empty files. The next few commands show you how touse shell metacharacters with the lscommand to match filenames. Try the followingcommands to see if you get the same responses: $ ls a* apple$ ls g* grapegrapefruit$ ls g*tgrapefruit$ ls *e* apple grape grapefruit watermelon$ ls *n* banana watermelonThe first example matches any file that begins with an a(apple). The next examplematches any files that begin with g(grape, grapefruit). Next, files beginning withg and ending in tare matched (grapefruit). Next, any file that contains an ein thename is matched (apple, grape, grapefruit, watermelon). Finally, any file thatcontains an nis matched (banana, watermelon). Here are a few examples of pattern matching with the question mark (?): $ ls ????eapple grape$ ls g???e* grape grapefruitThe first example matches any five-character file that ends in e(apple, grape). Thesecond matches any file that begins with gand has eas its fifth character(grape, grapefruit). Here are a couple of examples using braces to do pattern matching: $ ls [abw]* apple banana watermelon$ ls [agw]*[ne] apple grape watermelon07_
Note: In case you are looking for affordable webhost to host and run your servlet application check Vision ecommerce web hosting services