LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-18-2020, 12:06 PM   #1
browny_amiga
Member
 
Registered: Dec 2001
Location: /mnt/UNV/Mlkway/Earth/USA/California/Silicon Valley
Distribution: Kubuntu, Debian Wheezy/Jessie Stable, Windoze 7
Posts: 639

Rep: Reputation: 36
Search for several terms (AND) with locate / updatedb command


I have used the locate command for many years and like the fast response time that updatedb gives.
Now I'm switching over to using a GUI (Krusader has a GUI for it) and need to search two or more terms, that need to be all found (AND condition). How can I do this with the locate command itself, without using grep or something additional?

Is this possible via Regex?

I'm a little amazed that any search tool would not support AND OR selection, as it becomes pretty much useless, considering that we now have millions of files and search for just one term returns an uselessly huge amount of results. I do know that updatedb is ancient, so maybe it is just too old to handle requirements of the 21. century.

Is there an alternative to updatedb, maybe one that actually knows when files change, instead of having to scan the whole filesystem from scratch every time?
It should be something that is CLI based (but of course also with a GUI / frontend for easy access).
 
Old 05-18-2020, 12:10 PM   #2
shruggy
Member
 
Registered: Mar 2020
Posts: 935

Rep: Reputation: Disabled
From the GNU findutils manual:
Quote:
--all
-A
Print only names which match all non-option arguments, not those matching one or more non-option arguments.
 
Old 05-18-2020, 12:18 PM   #3
browny_amiga
Member
 
Registered: Dec 2001
Location: /mnt/UNV/Mlkway/Earth/USA/California/Silicon Valley
Distribution: Kubuntu, Debian Wheezy/Jessie Stable, Windoze 7
Posts: 639

Original Poster
Rep: Reputation: 36
Too bad, the GUI of course doesn't support this very important option:

https://docs.kde.org/trunk5/en/extra...er/locate.html

Do you know another GUI or frontend that uses locate and gives all the options?
 
Old 05-18-2020, 08:15 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 18,891

Rep: Reputation: 3207Reputation: 3207Reputation: 3207Reputation: 3207Reputation: 3207Reputation: 3207Reputation: 3207Reputation: 3207Reputation: 3207Reputation: 3207Reputation: 3207
Knock up a script, pop a dialog box with zenity or whatever and show the results.
Simple.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Find command is not able to search where as Locate is able to search JVandana Linux - Newbie 1 09-30-2018 10:06 PM
[SOLVED] Alternative of "updatedb" on linux(Ubuntu) or Run "updatedb" without root user(with normal user) rutul.5085 Linux - Newbie 3 05-06-2016 04:08 AM
updatedb crashes: src/updatedb.c:730: scan_cwd: Assertion `name_size > 1' failed sumanc Fedora 3 07-11-2008 04:39 PM
What's the difference between 'updatedb' and 'updatedb&' ?? DreameR-X Linux - Newbie 4 12-18-2004 04:36 PM
Quick VIM question (unhighlighting search terms after search) lrt2003 Linux - Newbie 5 05-08-2004 05:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:01 AM.

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