batch findstr
# EXAMPLE: display the files (within the given folder) that contain the text "+renew"
findstr /n /l "+renew" "C:\Users\LongW\*"
# SYNTAX
# findstr <options-if-any> "<string-to-find>" "<path(s)-to-search>"
# OPTIONS'
# /b Matches the text pattern if it is at the beginning of a line.
# /e Matches the text pattern if it is at the end of a line.
# /l Processes search strings literally.
# /r Processes search strings as regular expressions. This is the default setting.
# /s Searches the current directory and all subdirectories.
# /i Ignores the case of the characters when searching for the string.
# /x Prints lines that match exactly.
# /v Prints only lines that don't contain a match.
# /n Prints the line number of each line that matches.
# /m Prints only the file name if a file contains a match.
# /o Prints character offset before each matching line.
# /p Skips files with non-printable characters.
# https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/findstr
3
3
Find strings with case-insensitive search using -i flag as follows:
findstr -i "Case_insensitive_substring"
For example:
dir | findstr -i "Case_insensitive_file_name"
Thank you!
3
0
5
2
Just specify /S to search in all subfolders and match all files with regex *:
findstr /S string_to_search *
Thank you!
2
0
Are there any code examples left?
New code examples in category Shell/Bash
-
Shell/Bash 2022-03-27 22:30:33 wise highlight ubuntu
-
Shell/Bash 2022-03-27 22:25:19 how to send a pull request in git
-
Shell/Bash 2022-03-27 21:55:06 how to open terminal in sublime text ubuntu
-
Shell/Bash 2022-03-27 21:25:19 how to switch branch
-
Shell/Bash 2022-03-27 21:20:25 python
-
Shell/Bash 2022-03-27 21:20:04 set user as admin gitlab
-
Shell/Bash 2022-03-27 21:10:09 apache2 mod_jk proxy to tomcat connector
-
Shell/Bash 2022-03-27 20:35:12 chown
-
Shell/Bash 2022-03-27 20:15:08 awk last match