find


find \Windows\Command\find.exe

After searching the specified files, find displays any lines of text that contain the string you've specified for your search. find is useful for searching for specific words (strings) in files, but don't get it confused with Start Search For Files or Folders, which is capable of searching for text, files, directories, etc., and has many other capabilities that the find command doesn't have. The find options are:

 find [/v] [/c] [/n] [/i] [/offline] "   string   "     [   filename   [ ...]] 

Option

Description

" string "

The text to look for, enclosed in quotation marks.

filename

The file(s) in which to search. Although wildcards ( * , ? ) are not supported, multiple filenames can be specified as long as they are separated with commas. If filename is omitted, find searches text typed at the prompt or piped from another command via the pipe character ( ).

/c

Displays only the count of lines containing the string.

/i

Ignores the case of characters when searching for the string.

/n

Displays line numbers with the displayed lines.

/v

Displays all lines not containing the specified string.

/offline

Include files with the offline attribute set (that otherwise would be skipped ).

Examples

 find "redflag" myexployees.txt find /c "deceased" myexployees.txt for %f in (*.bat) do find "cls" %f >> cls.txt 


Windows XP Pocket Reference
Windows XP Pocket Reference
ISBN: 0596004257
EAN: 2147483647
Year: 2001
Pages: 154
Authors: David A. Karp

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net