In FreeBSD 12, on a freshly-created virtual machine (DigitalOcean), I tried to use the locate
command.
$ locate java
I received an error.
locate: database too small: /var/db/locate.database
Run /usr/libexec/locate.updatedb
So I ran locate.updatedb
.
$ /usr/libexec/locate.updatedb
Got a message, complaining about permissions.
/usr/libexec/locate.updatedb: cannot create /var/db/locate.database: Permission denied
Okay. Run as sudo.
$ sudo /usr/libexec/locate.updatedb
I got a security warning.
WARNING
Executing updatedb as root. This WILL reveal all filenames
on your machine to all login users, which is a security risk.
Unix is so much fun.
➥ What is the proper secure way to find a file or directory by name on your FreeBSD system?
locate
command has its database updated only daily or weekly. That is why you get the "too small" error.