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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
01-19-2005, 02:06 PM
|
#1
|
Member
Registered: Jan 2005
Location: Earth
Distribution: Fedora
Posts: 40
Rep:
|
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!
|
|
|
01-19-2005, 02:07 PM
|
#2
|
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
|
Just use find with -iname rather than -name. You would also be quicker using "locate" instead of find as it reads from a database.
|
|
|
01-19-2005, 02:38 PM
|
#3
|
Member
Registered: Jan 2005
Location: Earth
Distribution: Fedora
Posts: 40
Original Poster
Rep:
|
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!
|
|
|
01-20-2005, 12:32 AM
|
#4
|
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,430
|
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.
|
|
|
01-20-2005, 07:02 AM
|
#5
|
Senior Member
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,516
|
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 08:45 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|