LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-04-2014, 08:40 PM   #1
littlejoe5
Member
 
Registered: Aug 2006
Location: Arizona
Distribution: ubuntu dirivatives mostly Mate
Posts: 260

Rep: Reputation: 19
using mlocate - I'm learning


When I first tried mlocate, I was amazed at two things: First: How quick it was (almost instantaneous). And then: how much data it gave back (way too much to be useful).

I suppose that this is old hat to some of you old timers, but I finaly learned to use it with grep. Major improvement in narrowing the search. For Instance: "mlocate -i index | grep htm" will really cut down on the number of lines returned.

Another problem that bothered me was getting the gui file manager to interface with the information from mlocate. In most of them you can't just cut and paste the name of a long directory from the Terminal into the gui file manager. But I found a way around that, too: Just highlight the pathname of the directory that you want displayed in your file manager, and while still in your terminal, type the name of your file browser followed by a space, and then tap the middle mouse button and enter. For example, using file manager 'caja': "caja <tapa> /path/name/of/directory".

Or you can enter a document in Libreoffice in a similar way. Just highlight the comoplete pathname of the document file in the list that you have on your terminal from your mlocate search, and then go to Libreoffice writer:file>open and click on the small icon of a pencil. in the line that appears, tap the middle mouse button.

Once you get stated you'll find lots of other advavatages.
 
Old 07-04-2014, 09:22 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,189

Rep: Reputation: 4131Reputation: 4131Reputation: 4131Reputation: 4131Reputation: 4131Reputation: 4131Reputation: 4131Reputation: 4131Reputation: 4131Reputation: 4131Reputation: 4131
Hopefully you have read the manpage for [m]locate - it supports globbing in addition to both basic and extended regex. You can control to a significant degree how much output you get. But there are usualy still cases which require filtering as you suggested.
The file list used is a database created by updatedb, hence the speed advantage over tools like "find"
 
  


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
[SOLVED] RHCSA learning... RHEL6 or CENT OS for learning shejin983 Linux - Server 4 10-27-2012 09:16 AM
manipulating locate (mlocate, slocate) behaviour ajaxStardust Linux - General 4 09-12-2012 08:17 PM
locate: can not open `/var/lib/mlocate/mlocate.db': No such file or directory BallsOfSteel Linux - Newbie 4 12-11-2010 08:30 AM
Still learning kj4iai LinuxQuestions.org Member Intro 0 04-13-2010 04:29 PM
E-learning learning, VLS want to help other learn? scheidel21 General 0 04-06-2010 11:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:32 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
Open Source Consulting | Domain Registration