Linux locate command (find files)
The locate command can be used to find files on the system through a database that it maintains. Since it searches a database, the result is instantaneous. However, files recently added to the disk may not be in the database yet.
In this way, the database can be updated from time to time, or manually.
Example:
To update the database, the updatedb command must be run by root:
The locate command is not always installed as standard in distributions, which can be done with the apt or yum commands, depending on the distribution:
For Debian or Ubuntu distributions:
For Red Hat/CentOS/Fedora:
Learn much more about Linux in our online course. You can register here. If you already have an account, or want to create one, just log in or create your user here.
Did you like it?
Share