Right now, all I know to use is:
find / -name string.*
that is case sensitive and it won't find files named:
1string.x
STRing.x
string1.x
How can I search so that all the above would be returned in the search to a case-insensitive matching?
Case-insensitive file searching with the find command The key to that case-insensitive search is the use of the -iname option, which is only one character different from the -name option. The -iname option is what makes the search case-insensitive.
Case Insensitive Search By default, grep is case sensitive. This means that the uppercase and lowercase characters are treated as distinct. To ignore case when searching, invoke grep with the -i option (or --ignore-case ).
If you want the search for a word or phrase to be case insensitive, use the -iname option with the find command. It is the case insensitive version of the -name command.
The IGNORECASE is a built in variable which can be used in awk command to make it either case sensitive or case insensitive. If the IGNORECASE value is 0, then the awk does a case sensitive match. If the value is 1, then the awk does a case insensitive match.
Use the -iname
option instead of -name
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With