Other names | qgrep |
---|---|
Developer(s) | Microsoft, ReactOS Contributors |
Operating system | Windows,ReactOS |
Platform | Cross-platform |
Type | Command |
License | Windows:Proprietarycommercial software ReactOS:GNU General Public License |
Website | docs |
Incomputing,findstr is acommand in thecommand-line interpreters (shells) ofMicrosoft Windows[1][2] andReactOS.[3] It is used to search for a specifictext string incomputer files.[4]
The command sends the specified lines to thestandard output device.[5]It is similar to thefind
command. However, while thefind
command supportsUTF-16,findstr
does not. On the other hand,findstr
supportsregular expressions, whichfind
does not.Thefindstr
program was first released as part of theWindows 2000Resource Kit under the nameqgrep
.[6]
findstr
cannot search fornull bytes commonly found inUnicode computer files.[7]
FINDSTR flags strings [drive:][path]filename[...]
Arguments:
flags
This can be any combination of flags described below.strings
Text to be searched for.[drive:][path]filename
Specifies a file or files to search.Flags:
/B
Matches pattern if at the beginning of a line./E
Matches pattern if at the end of a line./L
Uses search strings literally./R
Uses search strings as regular expressions./S
Searches for matching files in the current directory and all subdirectories./I
Specifies that the search is not to be case-sensitive./X
Prints lines that match exactly./V
Prints only lines that do not contain a match./N
Prints the line number before each line that matches./M
Prints only the filename if a file contains a match./O
Prints character offset before each matching line./P
Skip files with non-printable characters./OFF[LINE]
Do not skip files with offline attribute set./A:attr
Specifies color attribute with two hex digits. See "color /?"/F:file
Reads file list from the specified file(/ stands for console)./C:string
Uses specified string as a literal search string./G:file
Gets search strings from the specified file(/ stands for console)./D:dir
Search a semicolon delimited list of directoriesNote:Following command displays the detailed help about this command:
FINDSTR /?
Save your running services into file _services.txt and search in this file for lines containing word "network" - case insensitive:
@echo offsetsearchstr=network net start>_services.txt FINDSTR /I"%searchstr%" _services.txtpause
output would be:
Network Connections Network List Service Network Location Awareness Network Store Interface Service Windows Media Player Network Sharing Service Press any key to continue . . .