Although the Find command search ability is strong, but for a large number of searches, find search is much slower, especially every time from the entire file system to search, then we can use the Locate command to find, the search is almost instantaneous things!
Locate mainly through the file name database to determine the location of files to search, he will automatically establish the entire system file name database, if you need to update the latest file name database, we can use the following command:
[Email protected]:~# updatedb[email protected]:~#
The basic usage syntax is as follows:
Locate keyword//keyword is primarily a file name or directory name
[Email protected]:~# Locate PASSWD/ETC/PASSWD/ETC/PASSWD-/ETC/CRON.DAILY/PASSWD/ETC/EXIM4/PASSWD.CLIENT/ETC/PAM.D /chpasswd/etc/pam.d/passwd/etc/security/opasswd
[Email protected]:~# locate/etc/shad/etc/shadow/etc/shadow-/var/lib/docker/aufs/diff/ F0ea6429bcad3d955456f12097b82ac4de51af9555aeb730d13aa8e54c57ebee/etc/shadow[email protected]:~#
This article is from the "eth10" blog, make sure to keep this source http://eth10.blog.51cto.com/13143704/1956726
Linux command--locate