Pages

Friday, August 27, 2010

Update Locate Database On BSD!

If you are familiar with Linux, you will appreciate the usefulness of "locate" utility.  For some people who are not aware of it, Wikipedia says "locate is a Unix utility first created in 1983 used to find files on filesystems. It searches through a prebuilt database of files generated by updatedb or a daemon and compressed using incremental encoding. It is significantly faster than find, but requires the database to be updated regularly."

Before you use locate, you need to update the database first. On Linux, it is easily done by
#updatedb

On BSD, I simply could not find updatedb. If I run locate without updating database, Error! "locate database is too small". Googling, I found how to update it. Following command will update the locate database.
#/usr/libexec/locate.updatedb

Finally, I can use locate to find files in FreeBSD. :)

No comments:

Post a Comment