How to use plocate?

I use mlocate to find files on my hard drive.
Today I’ve found plocate.
It seems that it should be faster and better optimized alternative for mlocate but… It doesn’t search / index files from my home directory.
I run plocate test, and it has found some files in system directories, but it didn’t find files in my Documents directory. And there are files with “test” in name.
I tried different options like -i but it didn’t help.
I also did updatedb.

1 Like

https://plocate.sesse.net/plocate.1.html
https://plocate.sesse.net/plocate-build.8.html

plocate-build creates an index from plocate (1) from an index earlier generated by updatedb (1) from the mlocate (1) package. This is currently the only way to build such an index.

1 Like

So to use plocate I’ll need to run 2 commands ?
updatedb and plocate-build
?

That is what the instructions say…

There is a service and a timer to regularly update the database.
systemctl status plocate-updatedb.timer
You can enable it and it will automatically trigger the service with:
systemctl enable plocate-updatedb.timer

1 Like

Hi,

I’m the author of plocate (but I don’t use Manjaro). If there are files you cannot find, there are two likely culprits:

First, check that the database has been updated recently. Most users will want to use plocate’s updatedb; plocate-build (which converts from mlocate’s database) is generally not what you want since plocate 1.1.0. As cjean says, this should normally go on a systemd timer.

The other reason why a file isn’t shown, is typically permissions. Check if you can find the files as root (sudo plocate test); if you can, the problem is most likely that you don’t have access rights to the directory all the way down from the root. plocate should find anything that find / -name *test* does, but no more.

1 Like