Search log files recursively, ignore letter case, and include line numbers in matches.
findstr /s /n /i "error" *.logSearch files for matching text using literal or regular-expression patterns.
findstr [/b] [/e] [/l | /r] [/s] [/i] [/x] [/v] [/n] [/m] [/o] [/p] [/f:<file>] [/c:<string>] [/g:<file>] [/d:<dirlist>] [/a:<colorattribute>] [/off[line]] <strings> [<drive>:][<path>]<filename>[ ...]The linked Microsoft Learn article is the upstream authority. Availability may depend on Windows release, role, optional feature or interactive tool context.
Search log files recursively, ignore letter case, and include line numbers in matches.
findstr /s /n /i "error" *.log| Option / clause | Description |
|---|---|
/i | Ignore case when matching. |
/n | Show line numbers. |
/s | Search the current directory and subdirectories. |
/r, /l | Interpret the pattern as a regular expression or literal text. |
/v, /c:<text> | Show non-matching lines or search for a literal string. |
/b | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
/e | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
/x | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
/m | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
/o | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
/p | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
/off[line] | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
/f:<file> | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
/c:<string> | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
/g:<file> | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
/d:<dirlist> | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
/a:<colorattribute> | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
/off | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
<strings> | Microsoft documents this argument or subcommand; check the linked reference for its required format and context. |
<drive> | Microsoft documents this argument or subcommand; check the linked reference for its required format and context. |
<path> | Microsoft documents this argument or subcommand; check the linked reference for its required format and context. |
<filename> | Microsoft documents this argument or subcommand; check the linked reference for its required format and context. |
Review a command and its target before running it. Commands that alter files, services, accounts, disks, permissions or databases may be difficult to reverse. Test in a safe environment and keep backups.