Basically locate command not installed in Linux server by default and while we are running locate command we receive following error message.
To resolve above error message install locate command on your server by using the following command.root@server [~]# locate test
-bash: locate: command not found
Log in to shell as root user and run following command.
Once locate command installation complete on your server, you can run locate command but it will throw you the following error message because mlocate.db (locate command database) is missing.root@server [~]#yum -y install mlocate
root@server [~]# locate test
locate: can not open `/var/lib/mlocate/mlocate.db': No such file or directory
To build mlocate.db run following command.
As soon as updatedb command complete, you will be able to run locate command without any problem.root@server [~]# updatedb






Reply With Quote
Bookmarks