Searching patterns in windows command prompt

You can use 2 commands to find the sub strings in a file.
  • find – used to find the sub string in a file or input text
  • findstr – finds patterns using regular expressions in a file or input text.

find command

Here is a syntax of find command.
 
find “<text-to-be-searched>” <file>

For example – if you want to search for string “amol” in a file called as names.txt, you can use below command.
 
find “amol” names.txt

findstr command

Here is a syntax of find command.
 
findstr “<regular-expression>” <file>

find-and-findstr-command-in-windows
find-and-findstr-command-in-windows

Web development and Automation testing

solutions delivered!!