/usr/libexec/locate.updatedb not working for Snow Leopard
Problem:
running sudo /usr/libexec/locate.updatedb results in the following error message:
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
find: .: Permission denied
Solution:
To create the database, run the following command:
sudo /usr/libexec/locate.updatedb /var/db/locate.database false
Please be aware that the database can take some time to generate; once
the database has been created, this message below will no longer appear.
WARNING: The locate database (/var/db/locate.database) does not exist.