Terminal Dojo
Help العربية Sign inGet started

Command library / findstr

findstr

CMDDraft — pending expert review4 practice missions

Search for text in files or piped output (the Windows grep)

Finds lines that contain a text. By default a search string with spaces is treated as SEVERAL words joined by OR; to search for an exact phrase use /c:"the phrase". It reads files, or the output of another command through a pipe.

Practice findstr

Usage

findstr [/i] [/n] [/v] [/s] [/c:"phrase"] strings [files]

Options and flags

Examples

Common mistakes

findstr "logon failure" security.log findstr /c:"logon failure" security.log

Without /c: the space means OR — you would also get lines containing only 'logon' or only 'failure'.

Related commands

netstatgrep