FIND: Locating a Text String in a File

You use the FIND command to search for a string inside a file. Here’s the syntax:

FIND [/C] [/I] [/N] [/V] "string" filename

/C

Displays the number of times that string appears in filename.

/I

Performs a case-insensitive search.

/N

Displays each match of string in filename with the line number in filename where each match occurs.

/V

Displays the lines in filename that don’t contain string.

string

The string you want to search for.

filename

The file you want to search in. (Note that you can’t use wildcards with the FIND command.) If the filename contains one or more spaces, surround it with double quotation marks.

For example, to find the string Xbox in a file named WishList.txt, you use the following command: ...

Get Windows 8 In Depth now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.