Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ignore case when trying to match file names using find command in Linux

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?

like image 962
Captain Claptrap Avatar asked Sep 22 '10 15:09

Captain Claptrap


People also ask

How do I ignore a case in find?

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.

Which of the following command ignores the case when searching in Linux?

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 ).

Which of the following is used to find for files using name and ignoring 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.

How do you ignore case sensitive in Unix?

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.


1 Answers

Use the -iname option instead of -name.

like image 191
llasram Avatar answered Oct 26 '22 07:10

llasram