I am not able to figure out how can I do case-insensitive search using the find command.

I tried

find . -name -i pattern

And it does not work.


Use this:

find . -iname PatTeRn -print
| improve this answer | |
  • 1. Providing the -print flag is redundant because if omitted, this is actually the default behavior. 2. TIL that the double quotes around the search term are optional. – rodey Mar 30 at 15:07

I believe it's: find . -iname pattern

From man find:

-iname pattern
       Like  -name, but the match is case insensitive.
| improve this answer | |
sudo updatedb

locate -i "nameofthefile"

nameofthefile should be without the inverted commas.

| improve this answer | |
  • It is notable that this is the fastest method for system-wide searches. – rm-vanda Sep 2 '14 at 5:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.