Locate

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help

Locate

Postby T J Tulley on Sat Nov 08, 2008 7:39 pm

The command locate according to its manual finds files by name from a database prepared by updatedb.

If I enter that as a command, I get: updatedb: can not open a temporary file for `/var/lib/mlocate/mlocate.db'

According to Notes in man locate, that is the path to the database searched by default. There are other notes about compatibility which I don't understand. How do I get locate to work, please?

With thanks in advance,
Yours hopefully -

Theo Tulley.
Using a PC with 2GB RAM, 3 hdds and a 1.7 GHz Celeron cpu.
User avatar
T J Tulley
Level 5
Level 5
 
Posts: 581
Joined: Wed Jul 18, 2007 10:18 am
Location: Hull, England

Linux Mint is funded by ads and donations.
 

Re: Locate

Postby clem on Sat Nov 08, 2008 7:54 pm

Code: Select all
sudo updatedb


And you can also use "find" to list files with a particular filename, "search" to find files containing a particular keyword (you need the latest mintsystem from Romeo for this to work), "dpkg -L package" to list all the files coming with a particular package and "dpkg -S filename" to list the package containing a particular file.

PS: With the latest mintSystem, the last two commands can also be written as "apt content package" and "apt contains filename".

Clem.
Image
User avatar
clem
Level 15
Level 15
 
Posts: 5566
Joined: Wed Nov 15, 2006 8:34 am

Re: Locate

Postby T J Tulley on Sat Nov 08, 2008 8:08 pm

Thanks Clem - I'm used to being asked "Are you root?" or something like that.
Yours hopefully -

Theo Tulley.
Using a PC with 2GB RAM, 3 hdds and a 1.7 GHz Celeron cpu.
User avatar
T J Tulley
Level 5
Level 5
 
Posts: 581
Joined: Wed Jul 18, 2007 10:18 am
Location: Hull, England


Return to Newbie Questions

Who is online

Users browsing this forum: Buzzsaw, glhallway, Google Adsense [Bot] and 32 guests