[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Unix Command Line - Find Command
<gids.rs@sasktel.net> wrote:
> Now, you may think. What is so special about the FIND command? It is
> just a pretty straight forward command. You tell it what to search for,
> and it finds it for you. You give it some criteria and it weeds out
> anything that does not match that criteria. The criteria usually will
> result with fewer files to allow you to choose from. Or. you may have
> the option to use a wild card character which usually results in more files to choose from.
>
> But, what if, I told you that the FIND command is the back bone to how a
> batch file works. For example, you can use the FIND command to find all
> files of a type $C1, which are graphic files, and then have a slide show,
> no matter where they are stored. You can FIND all the Finder.data files
> on a hard drive, then delete them all. You can FIND all files that start
> with a part of a name, and lock/unlock them all.
>
> That is kinda/sorta what this FIND command does. It finds all files that
> match your criteria, and has the ability to store the results in a text
> file. You can then edit the text file and put a disk command (delete,
> lock, unlock, view) in front of each prefix, then EXEC the text file.
> Yes, VIEW, can even be used when the UNIX command line is installed. It
> allows you to view most graphics.
>
> A couple of notes on the FIND command should be mentioned. FIND does not
> use the MLI OPEN function. So it will not work on network disks. It
> reads from a block device, which makes it very fast. Block numbers are
> pushed onto the stack when entering a Subdirectory header, and popped off
> the stack when the Subdirectory has been completely searched. This not
> only makes the search engine very fast, but also saves a lot of buffer
> space, since only 4 bytes are pushed onto the stack for each level of a
> directory. Directories rarely go more than 4-5 levels deep, so only 20
> bytes, at the most would ever get pushed onto the stack.
>
> Also, since every file is checked, a total file count of the entire hard
> drive can be displayed at the end of the search. You can also search by
> file type, i.e. $F, which is a folder, the number of files found will
> show how many folders are on your disk. The sames goes for any file type.
>
> At any rate, I don't think the FIND command should be underrated. It has
> great potential to be your best friend.
>
>
> Pushing the Apple II to the limit
>
> Rob
Now, if FIND puts some constant text--even a punctuation mark--in front of
each pathname in the generated text file, then a "replace all" will put the
desired command into what will be an EXEC file...
-michael - NadaNet 3.1 and AppleCrate II: http://home.comcast.net/~mjmahon