home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Micro R&D 1
/
MicroRD-CD-ROM-Vol1-1994.iso
/
os20
/
cli
/
find3720.lzh
/
Find.doc
< prev
next >
Wrap
Text File
|
1993-07-29
|
8KB
|
236 lines
Find 37.20 (26.7.93) © Reinhard Lübke (rel) : Documentation
=====================================================================
FORMAT
Find {<name|pattern>} [[DIR] <name>] [FL|FOLLOWLINKS]
[FILES] [DIRS] [SL|SOFTLINKS] [HL|HARDLINKS]
[SINCE <date>] [UPTO <date>] [OLDER <name>] [NEWER <name>]
[FLAGS {<flag|!flag>}] [EQ|EQUAL <n>] [GT|GREATER <n>]
[LS|LESS <n>] [EXEC <string>] [BUFFER <n>] [SUM] [QUIET]
[NOREQ]
TEMPLATE
PATTERN/A,DIR/M,ALL/S,FL=FOLLOWLINK/S,
FILES/S,DIRS/S,SL=SOFTLINKS/S,HL=HARDLINKS/S,
SINCE/K,UPTO/K,OLDER/K,NEWER/K,FLAGS/K,
EQ=EQUAL/K/N,GT=GREATER/K/N,LS=LESS/K/N,
EXEC/K,BUFFER/K/N,SUM/S,QUIET/S,NOREQ/S
PURPOSE
Search for specific filesystem objects.
PATH
C:Find
SPECIFICATION
Find scans through all directories passed to Find as arguments
and through all subdirectories of those when the ALL keyword is
given. If the FOLLOWLINK option is also enabled and Find will hit
a link, either soft or hard, then Find first checks if the link
destination is a directory and if so it will enter this
directory.
Note: If the link is a softlink it might be possible that
the link destination is on another volume which is
currently not mounted.
Find will also handle multidirectory assignments correctly.
During scan Find will match every filesystem object with the
given pattern. If it match, Find will check against the other
search criteria (see options below) and if they all say
"that's it" Find will output the object's name to stdout (except
if the QUIET option is enabled).
If the matching object is a link (either hard or soft) Find
will also print the link destination, even if a softlink
destination is not available (in this case Find will print a
warning). If at least one file matches the search criteria than
find will set the return level to 0 (RETURN_OK) otherwise to 5
(RETURN_WARN). Return levels other than 0 or 5 are indicating an
error.
Following, there is a detailed description of all possible
options:
PATTERN/A
That's what it is. The file name/pattern we are
looking for. Full AmigaDOS style pattern matching is
supported. See your AmigaDOS Manual for a full
description off pattern matching.
DIR/M
One or more directories in which Find will look for
files. If this argument is omited, the current
directory is searched by default. If one or more
arguments are multiassignments, they will be handled
correctly. See the ASSIGN command doc for setting up
multiassignments.
ALL/S
Normaly, Find will only scan through the directories
given as an commandline argument. If this option is
part of the command line, then Find will also scan
any subdirectory.
FOLLOWLINK/S
When scanning through subdirectories, Find will normaly
not follow any link to a directory. If this option is
part of the commandline, then Find will follow any
links to directories. Note, if the link is a softlink
it might be that the destination is a directory or
volume that is not available (e.g. not mounted).
In this case Find complains about this and goes on.
FILES/S
This tells Find to search for regular files.
DIRS/S
This tells Find to search for directories.
SOFTLINKS/S
This tells Find to search for softlinks.
HARDLINKS/S
This tells Find to search for hardlinks.
The above four filtype options can be combined in any way, so
that you can search for files and dirs or files and softlinks
or ... and so on. If none of of these options are selected, Find
will search for any filetype. But, if one or more of these
options are given, then Find will only take those filtypes into
account.
SINCE/K
Limits the search to filesystem objects created on or
after a certain date.
UPTO/K
Limits the search to filesystem objects created on or
before a certain date.
OLDER/K
Limits the search to filesystem objects created
before a certain file's creation date.
NEWER/K
Limits the search to filesystem objects created
after a certain file's creation date.
Each of the above four keywords can be combined in any way to
create a reasonable date boundary. Valid dates for SINCE & UPTO
are as follows: "23-jul-93" or "yesterday" etc. The OLDER & NEWER
keywords are expecting filenames.
FLAGS/K
This tells Find to search for objects that have specific
file and protection flags set and/or unset. This option
accepts the following flags:
h = hidden (normaly not used)
s = script
p = pure
a = archived
r = readable
w = writeable
e = executable
d = deleteable
A flag with a leading '!' means that Find should search
only for those objects that have this specific flag not
set.
Example: "FLAGS=!ase!w" will match only those files that
are NOT archived and NOT writable and that are scripts
and executable.
EQUAL/K/N
Limits the search to filesystem objects that are
exact of a specific size (in bytes).
GREATER/K/N
Limits the search to filesystem objects that are
greater than a specific size (in bytes).
LESS/K/N
Limits the search to filesystem objects that are less
than a specific size (in bytes).
EXEC/K
Allows you to run any valid AmigaDOS command each time
a filesystem object matches the various search
criteria. The name of the object is inserted in the
command string on every occurrence of the substitution
operator %S (or %s).
Note: During command execution the directory where the
object was found becomes the current directory.
BUFFER/K/N
With BUFFER you can expand (or shrink) the buffer
that is allocated for holding a complete pathname.
If you have very long file and directory names and
you recursively scan through a big partition
with many subdirectories, you might run into the
error condition LINE TOO LONG. If so, try BUFFER=<n>
where n is greater than 512. The default value of
buffersize is 512.
SUM/S
Displays a summary report at the end of the scan
(even if the QUIET option is given).
QUIET/S
Disable all outputs except the summary report.
NOREQ/S
Disables all AmigaDOS requesters.
EXAMPLES
1> find #?.(c|h)
Displays all files in the current directory with extension c or h
1> find #?.bak work: ALL EXEC "delete %s"
Displays all files on volume work: and all subdirectories with
extension bak and runs the command delete on them.
1> find #? sys: work: ram: SOFTLINKS HARDLINKS ALL
Displays all links, either hard or soft, on volume sys: work: and ram:
together with their link destination.
1> find #?.c newer pickfile.c since yesterday
Displays all files with extension c in the current directory which
are created since yesterday and which are newer than pickfile.c
1> find #? sys: ALL FL FILES FLAGS s!e EXEC "protect %s +e"
Will run the protect command on all files on volume sys: that are
scripts and don't have the execuatble flags set. During scan find will
follow any link to a directory, so there might be files on other volumes
affected (if the link is a softlink).
1> find #?.h INCLUDE: all files GT 2000 LS 5000
Displays all files in directory INCLUDE: (and all subs) that are greater
than 2000 bytes and less than 5000.
1> find #?.(c|h|a) PROJECTS: ALL GT 1000 LS 3000 EXEC "list %s lformat
*"%%30N = %%6L bytes long*" nohead" QUIET
might produce the following output:
trackmon.h = 1909 bytes long
wildstar.c = 2025 bytes long
CxKey.c = 2702 bytes long
WatchFile.h = 2200 bytes long
data.c = 2160 bytes long
Notice the double % sign in the lformat string. That is because the EXEC
keyword itself looks for a '%', so you have to do a double % to get a
single one.