locate reads one or more databases prepared by updatedb(8) and writes
file names matching at least one of the PATTERNs to standard output,
one per line.
Run updatedb as root and try again. It should work.
Alternatively you can use find or find | grep, which does not uses a db (and thus is considerably slower).
The locate command uses a database, which is updated about once a day. While it gives fast results, it isn't necessarily accurate. If locate says a file exists, but it isn't there, it was moved or deleted after the last database update. Also see A file shows in “locate” command but don't exist. Why?
Best Answer
From the man page:
Run
updatedb
as root and try again. It should work.Alternatively you can use
find
orfind | grep
, which does not uses a db (and thus is considerably slower).