Motivation:
Find a string in all files in a directory without having to install an external program that may decrease system security.
Method 1:
- Open a command prompt (cmd.exe)
- Go to the directory and
- Execute below command:
find /i "search string" *.*
/i: ignores the case of your search string.
Examples:
find /i "app files were copied" *.*
find /i "were copied" *.log
Method 2:
- Open a command prompt (cmd.exe)
- Go to the directory and
- Execute below command:
findstr /s "search string" *.*
/s: searches for each word in your search string.
or execute below command:
findstr /C:"search string" *.*
/C: searches for exact match of your search string .
Examples:
findstr /s "Integrated Security=true" *.cs
findstr /C:"app files were copied" *.log
(Visited 47 times, 1 visits today)