How to install locate command in Linux Redhat and Centos
To install the locate command (mlocate) in Redhat or Centos, use the ’YUM’ command, install function.
- Logon as ‘root — or use with âsudo â permissions
- Then, run a âman â command to confirm that the locate command is not already installed: âman locateâ
Example âmanâ command (as root user)
[root@blog-server ~]# man locate
- If the âmanâ documentation page returns, then it is already installed. If no âmanâ documentation page is returned, then run the âyum installâ command.
- Run the âyum install â command as âroot â or âsudo â user:
Example âyum installâ command (as root user)
[root@blog-server ~]# yum install mlocate
Example âyum installâ command (as sudo user)
[root@blog-server ~]# sudo yum install mlocate
Then run the [root@data-server ~]# updated
Example Run âupdatedbâ Command (as Root user)
[root@blog-server ~]# updated
Example Run âupdatedbâ Command (as sudo user)
[root@blog-server ~]# sudo updated
Discover more from Life Happens!
Subscribe to get the latest posts sent to your email.

One thought on “How to install locate command in Linux Redhat and Centos”
Comments are closed.