Last active
June 17, 2024 23:21
-
-
Save chrisRedwine/dc4d2f7ee835de07d1cd97fbb1e99147 to your computer and use it in GitHub Desktop.
Windows command to recursively search for a string in a directory and output results to txt file (s = recursive, i = case insensitive, n = line number detail)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
findstr /sin “searchstring” *.* > output.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this. This is the second result on google when I search "findstr recursive". I suggest you make an edit for those of us living in corporate world under the microsoft onedrive cloud where files are pulled from the computer to the cloud. Adding /OFFLINE forces the files in the directory to be downloaded locally before the search is done.
FINDSTR: Files with offline attribute were skipped.
Use /OFFLINE for not skipping such files.
findstr /OFFLINE /sin “searchstring” *.* > output.txt