|
FIND
Searches for a specific string of text in a file or files.
Syntax
FIND [/V] [/C] [/N] [/I] "string" [pathname(s)]
key
/V : Display all lines NOT containing the specified
string.
/C : Count the number of lines containing the string.
/N : Display Line numbers.
/I : Ignore the case of characters when searching for
the string.
"string" : The text string to find (must be in quotes).
[pathname] : A drive, file or files to search.
You can type parameters and command-line options for the
FIND command in any order.
If a [pathname] is not specified, FIND will prompt for text
input or will accept text piped from another command.
You cannot use wildcards (that is, * and ?) in file names or
extensions that you specify with the find command.
The FIND command does not recognize carriage returns.
Examples
If you want to search for a set of files, you can use the
FIND command with the for command.
for %f in (*.bat) do find "PROMPT" %f
To display all lines from Memo.txt that contain the string
"Meeting", type:
find "Meeting" memo.txt
If you want to pipe a command into FIND use this syntax:
TYPE Report.txt | FIND "April"
Cmd Commands
|