This Article shows you How to have a Freshly Updated Locate Database for Searching/Finding Stuff on Linux.
The locate Command is the Easiest and Fastest Way to Find and Search for Files, Directories, Images and Paths on the Unix-like Systems.
If you want to Find a Tutorial for Getting-Started with the Locate Command you Find a Link Inside the Guide.
Relax and Take the Time for Reading, Understanding and Enjoying the Clear Insight Brought to you by this Guide.
-
Open a Terminal Window
(Press “Enter” to Execute Commands) - Check the updatedb Location
which updatedb
The updatedb Path in Most Linux Distros should be: /usr/bin/updatedb.
If you Do Not Get any Output find Documentation About the updatedb Command for your System.
- Login as Superuser
su
If Got “User is Not in Sudoers file” then see: How to Enable sudo
- Edit the Root Crontab
crontab -e
The File will be Open on your Default System Terminal Editor and this is One between Two:
-
nano
-
vi
.
-
- To have a Database Updated Hourly Add this Line to the Crontab
58 * * * * /usr/bin/updatedb
In vi Editor you Need to Hit the “i” Key to Enter in Editing Mode.
- Save & Exit with
-
On nano: Ctrl+x
-
On vi:
-
Esc
-
:wq
-
-
-
For Getting-Started Using the locate Command.