Locate

Quick to answer questions about finding your way around Linux Mint as a new user.
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. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
T J Tulley
Level 5
Level 5
Posts: 558
Joined: Wed Jul 18, 2007 10:18 am
Location: Hull, England

Locate

Post by T J Tulley »

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,
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Yours hopefully -

Theo Tulley.
Using a PC with 2GB RAM, 3 hdds and a 1.7 GHz Celeron cpu.
User avatar
clem
Level 12
Level 12
Posts: 4308
Joined: Wed Nov 15, 2006 8:34 am
Contact:

Re: Locate

Post by clem »

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
T J Tulley
Level 5
Level 5
Posts: 558
Joined: Wed Jul 18, 2007 10:18 am
Location: Hull, England

Re: Locate

Post by T J Tulley »

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.
Locked

Return to “Beginner Questions”