Linux uses the locate command to locate a file
From: http://linux-blog.org/finding-files-with-locate/
FIND command
Many Linux users like to use the find command to find files. For example, they usually like this:
Find/-name 'pattern'
Indeed, the powerful function of find is not only used to find files, but also to locate more details, for example, if you want to find some write permissions (if you want to find files which are writable by both their owner and their group) in a directory, you can do this:
Find/-perm-444-perm/222! -Perm/111
Or you want to see the files modified in the last 24 hours under your download directory,
Find/home/user/Downloads/-mtime 0
The find command is not only used to search for files, but also takes time to search for disks. Is there a way to quickly locate it?
LOCATE command
Before using locate, make sure that the mlocate package is installed in the system. Most Linux distributions now integrate this package. If not installed, you can access the mlocate home page (http://carolina.mff.cuni.cz /~ Download and install trmac/blog/mlocate. After the download and installation are successful, you need to execute a command to index your file system. Otherwise, you have to wait until the program is automatically executed.
Run the following command as the root user:
Updatedb &
This command updates your mlocate database in the background, this database contains the index of your file system (This updates the mlocate database that indexes your files and forks it to the background (the '&' forks it to the background ).
After this command is executed, you can easily use the locate command:
Locate firefox | less
This will quickly locate firefox files, directories, and so on. The speed is faster than find, because it reads the index in the mlocate database!