Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-19-2005, 03:06 PM   #1
Registered: Jan 2005
Location: Earth
Distribution: Fedora
Posts: 40

Rep: Reputation: 15
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?

Old 01-19-2005, 03:07 PM   #2
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Just use find with -iname rather than -name. You would also be quicker using "locate" instead of find as it reads from a database.
Old 01-19-2005, 03:38 PM   #3
Registered: Jan 2005
Location: Earth
Distribution: Fedora
Posts: 40

Original Poster
Rep: Reputation: 15
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!
Old 01-20-2005, 01:32 AM   #4
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,340

Rep: Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745
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
Old 01-20-2005, 08:02 AM   #5
Senior Member
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to search in VI wih case insensitive lordofring Programming 7 11-16-2011 09:11 AM
Problem in case command - RH9 Gald3r Red Hat 1 09-19-2005 07:52 PM
having fstab-sync mount fat case-insensitive eliotstock Linux - General 9 06-05-2005 01:55 PM
case-insensitive auto-complete gSalsero Programming 3 06-08-2004 08:33 AM
mySQL LIKE search is case sensitive? icepig Linux - Software 4 11-14-2003 05:29 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:17 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration