LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   case insensitive search command (https://www.linuxquestions.org/questions/linux-newbie-8/case-insensitive-search-command-279803/)

ColKurtz 01-19-2005 03:06 PM

case insensitive search command
 
Is there a case-insensitve search command in linux, preferably CLI based? As I read and learn about linux, sometimes files are mentioned that might exist in a number of different directories. If I was trying to find XF86Config, for example, it would be nice if I could just search on xf86* or xf86*.*

LS and FIND both appear to be case-sensitive. Any hope for the lazy?

Thanks!

david_ross 01-19-2005 03:07 PM

Just use find with -iname rather than -name. You would also be quicker using "locate" instead of find as it reads from a database.

ColKurtz 01-19-2005 03:38 PM

Ahhh.... Many thanks on the locate command, which I had not yet seen. That's exactly what I'm looking for, and the little grounbreaking type of things that allows one to learn faster. I can't tell you how frustrating it has been reading an article that says to edit file X, but I can't find that file.

Thanks again!

chrism01 01-20-2005 01:32 AM

You could also use
grep -rnHi <patt> <filelist>

From the man page:
-i, --ignore-case
Ignore case distinctions in both the PATTERN and the input
files.

bigearsbilly 01-20-2005 08:02 AM

remember though
locate (correct me if I'm wrong)
only works for as recently as the locate DB has
been updated.


All times are GMT -5. The time now is 07:58 PM.