Find
| Formát: | FIND [{<dir>}] [NAME <name>] [EXACTNAME] [CASENAME] [COMMENT <com>] [EXACTCOMMENT] [CASECOMMENT] [CONTENTS <content>] [CASECONTENTS] [MINSIZE <minsize>[B|K|M|G|T]] [MAXSIZE <maxsize>[B|K|M|G|T]] [WITHIN <time>[MI|H|D|W|M]] [BETWEEN <startdate>-<enddate>] [PROT <pro>] [NOSIZES] [NODATES] [LFORMAT <format>] [GUIMODE <mode>] [REQ] |
| Šablona: | DIR/M, NAME/K, EXACTNAME/S, CASENAME/S, COMMENT/K, EXACTCOMMENT/S, CASECOMMENT/S, CONTENTS/K, CASECONTENTS/S, MINSIZE/K, MAXSIZE/K, WITHIN/K, BETWEEN/K, PROT/K, NOSIZES/S, NODATES/S, LFORMAT/K, GUIMODE/K, REQ/S |
| Účel: | Příkaz FIND umožňuje vyhledávat soubory podle názvu, obsahu, velikosti a nebo komentářů. |
| Cesta: | SYS:System/Find |
Příkaz FIND vyhledá v aktuálním adresáři soubory odpovídající určitým kritériím a vypíše o nich informace. Pokud zadáte alespoň jeden argument <dir>, příkaz FIND prohledá zadané adresáře. V případě neuvedení žádného argumentu kritéria bude za vyhovující považován jakýkoli soubor.
Pokud nejsou zadány jiné volby, zobrazí FIND následující informace:
Argument NAME se pokusí vyhledat soubor podle daného názvu.
Argument SIZE slouží k upřesnění velikosti hledaného souboru v bajtech. U odkazů tento argument zobrazuje, co by měl cílový objekt zobrazovat.
Argument PROTECTION
protectionThe protection bits that are set for this file are shown as
letters. The clear (unset) bits are shown as hyphens. Most files
will show the default protection bits, ----rwed for
readable/writable/executable/deleteable.
See the PROTECT command for more on protection bits.
date & time
The date and time the object was created or last altered.
For links, this will display the target datastamp information.
path
The path where the file is located.
comment
The comment, if any, placed on the file using the FILENOTE
command.
OPTIONS
FIND has options which will change the file matching criteria or
the way the output is displayed.
These options are explained below:
NAME <name>
Lists only files which contains <name> in their filename.
EXACTNAME
Will only list files with a filename of <name> (i.e. do not
consider <name> as a substring of the filename).
CASENAME
Will only list files with filename of the same case as <name>.
COMMENT <com>
Lists only files which contains <com> in the comment attached.
See FILENOTE for more details on file comment.
EXACTCOMMENT
Will only list files with a comment of <com> (i.e. do not
consider <com> as a substring of the comment).
CASECOMMENT
Will only list files with comment of the same case as <com>.
CONTENTS <content>
Lists only files with <content> in their contents.
CASECONTENTS
Will only list files containing <content> with the same case
as <content>.
MINSIZE <minsize>[B|K|M|G[T]
Lists only files with a size greater or equal to <minsize>.
The size unit may be specified after the value:
- B for bytes (default)
- K for kilobytes
- M for megabytes
- G for gigabytes
- T for terabytes
MAXSIZE <maxsize>[B|K|M|G[T]
Lists only files with a size lower or equal to <maxsize>.
The size unit may be specified after the value:
- B for bytes (default)
- K for kilobytes
- M for megabytes
- G for gigabytes
- T for terabytes
WITHIN <time>[MI|H|D|W|M]
Lists only files within a timespan of <time> from the current
date and time.
The timespan unit may be specified after the value:
- MI for minutes
- H for hours
- D for days (default)
- W for weeks
- M for months
BETWEEN <startdate>-<enddate>
Lists only files between <startdate> and <enddate> included.
Dates are parsed as the current short locale format.
NOSIZES
Will not display file size information.
NODATES
Will not display date and time information.
LFORMAT
Defines a string to specially format FIND output.
GUIMODE <mode>
Selects if FIND shall be launched in GUI mode instead of the
shell mode. Normally, FIND would only start in GUI mode when
started from the Workbench. When <mode> is anything else than
'no' or 'yes' FIND will launch in GUI mode.
This option may be convient for scripts.
REQ
This is a short synonym of GUIMODE yes.
The LFORMAT option modifies the output of FIND and can be used as
a quick method of generating script files. When using LFORMAT you
must specify an output format specification string; this string is
incorporated into the script file. If you want the output to be
saved, you must redirect it to a file by using the > operator.
The format for the output format specification string is
LFORMAT=<string>. To include the output of FIND in this string, use
one of the following field operators:
%b Prints file attributes (protection bits).
%c Prints any comments attached to the file.
%d Prints the date associated with the file.
%f Prints the full file parent path (same as %p).
%l Prints the length of file in bytes.
%n Prints the name of the file.
%p Prints the file parent path.
%t Prints the time associated with the file.
%w Prints the file parent path without the ending '/'.
You can put a length specifier and/or a justification specifier
between the percent size (%) and the field specifier. The format is
as follow:
%[[.][-]<n>]<f>
<f> One of the field listed above.
<n> Prints at least <n> characters for the selected field by
padding with spaces on the left. If the value is longer
then no padding is applied and the whole value is printed
(see '.' below).
. Truncates the printed value to at most <n> characters,
still applying padding if it is shorter.
- Applies padding to the end of the printed value when it is
shorter than <n> characters.
EXAMPLES
1> FIND RAM:
au.log 2355 ----rwed 16/09/2023 09h13 RAM:
Disk.info 7946 ----rw-d 19/09/2011 20h34 RAM:
0 280 ----rwed 16/09/2023 11h47 RAM:Clipboards
Notifications.log 2352 ----rwed 16/09/2023 10h39 RAM:T
usb.log 18733 ----rwed 16/09/2023 09h12 RAM:T
blanker.log 1519 ----rwed 16/09/2023 11h08 RAM:T
All files recursively found in the specified directory, in this case
RAM:, are listed. (Due to layout constraints, a shortened version of
the typical output is shown above.)
1> FIND RAM: NAME log
au.log 2355 ----rwed 16/09/2023 09h13 RAM:
Notifications.log 2352 ----rwed 16/09/2023 10h39 RAM:T
usb.log 18733 ----rwed 16/09/2023 09h12 RAM:T
blanker.log 2030 ----rwed 16/09/2023 11h08 RAM:T
FIND recursively searches RAM: for any files containing log in
their filename no matter of the case.
1> FIND >RAM:Scriptnotes RAM: NAME log LFORMAT="FILENOTE %p%n Log"
A new script file, Scriptnotes, is created in RAM:. The contents will
include a list of all the files recursively found in the RAM: with a
name containing log. When Scriptnotes is executed, it will add the
filenote Log to each file. For instance, with the same files in RAM:
as in the above examples, the contents of Scriptnotes as produced by
this command might look like this:
FILENOTE RAM:au.log Log
FILENOTE RAM:T/Notifications.log Log
FILENOTE RAM:T/usb.log Log
FILENOTE RAM:T/blanker.log Log
BUGS
Prior to version 53.17, the WITHIN argument was incorrectly parsed
returning unexpected results.
Prior to version 53.17, the BETWEEN argument was not taken into
account at all.
SEE ALSO
PROTECT
FILENOTE



