LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 01-19-2005, 03:06 PM   #1
ColKurtz
Member
 
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?

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

Rep: Reputation: 66
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
ColKurtz
Member
 
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
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
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.
 
Old 01-20-2005, 08:02 AM   #5
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Debian, Mint, Puppy, Raspbian
Posts: 3,420

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


Reply


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


All times are GMT -5. The time now is 06:53 PM.

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