Amiga World Official AmigaDOS 2 Companion - eBook-ENG

Page 239

Delving into AmigaDOS

22 1

The template for Search differs in important ways from the one given in Commodore's documentation. It is: FROM/A/M,SEARCH/A,ALL/S,NONUM/S,QUIET/S, QUICK/S,FILE/S,PATTERN/S

FROM/A/M lets you indicate the files you want to search. You can search a single file, multiple files, or multiple directories, or use pattern matching to determine which files to search. The SEARCH/A argument is the string you want to find. It can contain pattern-matching wildcards, but you need not worry about capitalization because Search ignores case. If the search string includes a space, you must enclose the entire string in double quotes. Thus, to search all the files in your Work:WordProcessing drawer for the sequence Bud get 1991, you enter:

SEARCH WORK:WORDPROCESSING Budget 1991

The Search command responds by listing all the files it has searched, and all the occurrences of the string in those files. It prints both the line number and the contents of all lines in the files containing the string. Search gives you three output options and two search options. The NONUM/ S argument lists the lines that match the search string without using line num bers. QUICK/S outputs the files that contain matches for the search string, without displaying the matching lines. QUIET/S lists only the files that pro duce a match.

If you specify a directory for your search, the ALL/S option not only lets you search that directory, but also look through all the files and directories below the specified one in the AmigaDOS file structure. The FILE/S options let you indicate that the string you're searching for is a filename and not a text string within a file. Thus, to search your entire Workbench disk for a file named Clock, you enter: SEARCH Workbench2.0: Clock FILE ALL

Search then does a quiet search of your entire disk, listing the complete pathnames of all files named Clock. Note that you can't search for directories using FILE/S.

For my money, the ability to find a filename anywhere on a disk is the most useful function provided by Search. I never used this command before re searching this book; now I use it all the time to find files that I've lost on my hard drive.


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.