Home Page The Club Computers News Links Glossary EYAWTK
Before Amiga Background ICS OCS ECS AGA ??? PPC
U-Boot SLB Linux Amiga OS Dual Boot Motherboards Peripherals Other
Initialisation Installation OS4 Updates About OS4 File Systems Networking Printing Other
Introduction File System Workbench Preferences Commands Error Msgs Miscellaneous

AmigaOS 4.0 - About OS4 - Commands

FIND AmigaDOS
Purpose: To find files on your system based on various criteria.
Format: FIND {<device name | directory name>} [NAME <filename | file pattern>] [COMMENT <comment | comment pattern>] [MINSIZE <min>] [MAXSIZE <max>] [WITHIN <within>] [BETWEEN <between>] [PROT <prot>] [CONTENTS <contents>] [EXACTNAME yes | no] [EXACTCOMMENT yes | no] [CASENAME] [CASECOMMENT] [CASECONTENTS] [NOSIZES] [NODATES] [LFORMAT <lformat>] [GUIMODE yes | no] [REQ]
Template: DIR/M, NAME/K, COMMENT/K, MINSIZE/K, MAXSIZE/K, WITHIN/K, BETWEEN/K, PROT/K, CONTENTS/K, EXACTNAME/S, EXACTCOMMENT/S, CASENAME/S, CASECOMMENT/S, CASECONTENTS/S, NOSIZES/S, NODATES/S, LFORMAT/K, GUIMODE/K, REQ/S
Path: SYS:System/Find
FIND can be used to locate files on your system based on various criteria.

The <device name > or <directory name> argument can be used to specify the device or directory in which to search. If neither is specified it defaults to the current directory.

There are numerous options available for specifying the filtering criteria, which can be also be used in combination. If no selection criteria are specified, all files will be returned. The options are:

NAME This argument filters filenames and enables you to search for a specific <file string> matching against a full filename if EXACTNAME is "YES", a substring filename if EXACTNAME is "NO" or not specified, or using a <file pattern>, additionally matching on case if the CASENAME argument is "YES".
COMMENT This argument filters filenotes and enables you to search for a specific <comment string> matching against the exact comment text if EXACTCOMMENT is "YES", substring comment text if EXACTCOMMENT is "NO" or not specified, or using a <comment pattern>, additionally matching on case if the CASECOMMENT argument is "YES".
MINSIZE This argument filters filesizes and enables you to exclude files smaller than the specified <minsize> value.
MAXSIZE This argument filters filesizes and enables you to exclude files larger than the specified <maxsize> value.
WITHIN Haven't sussed out how to use this argument yet!!! Does anybody know??? Please email me via club website.
BETWEEN Haven't sussed out how to use this argument yet!!! Does anybody know??? Please email me via club website.
PROT This argument filters file-protection-bits and excludes files where <prot> doesn't match.
CONTENTS This argument filters the content of any files which meet the all of the above criteria and enables you to search for a <contents string> within the file, additionally matching on case if the CASECONTENTS argument is "YES".

All files that meet all of the above selection criteria will be output to the current window, showing filename, filesize, protection bits, date last updated, time last updated, and the drawer that it resides in, for example:

usb.log                        318 ----rwed 09/02/06 16:19:18 RAM:T The following arguments can be used to customise this output:

NOSIZES This argument suppresses output of the filesize and protection bit information.
NODATES This argument suppresses output of the protection bit, date and time information.
LFORMAT This argument modifies the output of the date and time information using one or more substitution operators. The available substitution operators for <lformat> are:
  %a
%A
%b
%B
%c
%d
%D
%e
%h
%H
%I
%j
%m
%M
%n
%p
%q
%Q
%r
%R
%S
%t
%T
%U
%w
%W
%x
%X
%y
%Y
- abbreviated weekday name
- weekday name
- abbreviated month name
- month name
- same as "%a %b %d %H:%M:%S %Y"
- day number with leading 0s
- same as "%m/%d/%y"
- day number with leading spaces
- abbreviated month name
- hour using 24-hour style with leading 0s
- hour using 12-hour style with leading 0s
- julian date
- month number with leading 0s
- the number of minutes with leading 0s
- insert a linefeed
- AM or PM strings
- hour using 24-hour style
- hour using 12-hour style
- same as "%I:%M:%S %p"
- same as "%H:%M"
- number of seconds with leadings 0s
- insert a tab character
- same as "%H:%M:%S"
- week number, taking Sunday as first day of week
- weekday number
- week number, taking Monday as first day of week
- same as "%m/%d/%y"
- same as "%H:%M:%S"
- year using two digits with leading 0s
- year using four digits with leading 0s

Then, if all you want to do is invoke the GUI window, you can do this either from the standard Window menu on the Workbench, from the Find icon in the System drawer, or from a Shell in which case you can ignore all of the above and simply specify GUIMODE=YES where you can enter a restricted set of the above selection criteria interactively using the following window:

All of the available devices are already shown and are automatically ticked. If you do not want Find to search a particular device you must untick it. On the other hand, if you want your search to be more restrictive than the entire device, you must either open the drawer that you want to search and make it active befor invoking Find, or you can use the Search Path menu and click on Add Path or simply use the Right-Amiga P shortcut to add the desired directory for your search (it will automatically be ticked).

Pattern can be used to specify the name or pattern to use for a filename search. If you want to perform the equivalent of an EXACTNAME search, you must untick 'Substring filename search?' in the Settings menu. If you want your search to be case-sensitive you must tick 'Case sensitive?' in the Settings menu.

Contents can be used to specify the name or pattern to use for a contents search. If you want your search to be case-sensitive you must tick 'Case sensitive?' in the Settings menu. Unlike Shell mode you cannot differentiate between filename and contents when specifying case in GUI mode.

There is no provision to perform a filenote search, or specify filters for filesizes or protection bits using the GUI mode.

A number of the arguments above accept "YES" keywords - it should also be noted that "ON" or "1" are also acceptable to suit various scripting options, while "NO" is generally anything else.

Once you find what you are looking for, you can simply click on the file name shown to start the program or activate the associated tool.

When run from the shell, the FIND command defaults to perform its actions within that shell. However, if you want to invoke the command from the shell and still use the graphical user interface, use the REQ argument.

Example 1:

3.OS4:> FIND RAM:
CRSB047.jpg                25,580 ----rw-d 09/02/06 16:32:03 RAM:
example.gif                 3,127 ----rwed 09/02/06 16:27:43 RAM:
usb.log                       318 ----rwed 09/02/06 16:19:18 RAM:T
No filtering specified, so displays all files currently in RAM:.

Example 2:

3.OS4:> FIND RAM: NAME SB NOSIZES
CRSB047.jpg              09/02/06 16:32:03 RAM:
usb.log                  09/02/06 16:19:18 RAM:T
Filters on filename finding only files with 'SB' in the filename. NOSIZES used to suppress size and protection bit output.

Example 3:

3.OS4:> FIND RAM: NAME SB CASENAME NODATES
CRSB047.jpg                25,580 RAM:
Filters on filename finding only files with 'SB' in exact case in the filename. NODATES used to suppress date/time and protection bit output.


Return to Commands Selection

Disclaimer: Amiga Auckland have prepared the above information for the use of its members based on our experiences and as such is subject to revision at any time. Amiga Auckland cannot guarantee any of the information and cannot be held accountable for any issues that may result from using it.


Copyright 2006 Amiga Auckland Inc. All rights reserved.
Revised: December 24, 2006.