6-22 ROM-DOS Commands
MX2 Reference Guide Revision A MX2A137REFGD
FIND.EXE
Type
External
Purpose
FIND is a filter to display only lines that contain a specified string.
The input to FIND may come from a file, or it may be piped in from
another filter or a DOS command.
Syntax
FIND [/option] match-string [filename]
Options
The /C option causes FIND to only display the count of lines found with
the specified string.
The /N option causes FIND to display the line number of the line found
containing the string.
The /V option causes FIND to display the lines that do not contain the
string.
The match-string argument specifies the word or group of characters to
search for.
The filename argument specifies the file or group of files to search in.
The complete drive and path can be specified. Wildcard characters can
be used in the filename.
Examples
The following example shows each line in the file JUNK.C that contains
the string “printf”.
FIND printf junk.c
The following example shows each line in a directory listing that
contains a DIR. The command first executes a DOS DIR command with
the output piped into the FIND command. The FIND command then
displays each line that contains the string “DIR”.
dir ¦ FIND DIR
The following example give a count of the lines in the file
MANUAL.TXT that contain the string “ROM-DOS”.
FIND /C ROM-DOS MANUAL.TXT
.....MANUAL.TXT: 105