Windows Command Prompt TutorialIntroduction Internal and External commands Basic Commands Basic file commands Sorting the data Searching patterns in file Comparing files Variables in Windows command prompt Piping Input and Output Redirection View all processes and tasks killing tasks scheduling tasks Network commands System hardware commands
Searching patterns in windows command promptYou 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 commandHere is a syntax of find command.
For example – if you want to search for string “amol” in a file called as names.txt, you can use below command.
find “<text-to-be-searched>” <file>
find “amol” names.txt
findstr commandHere 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