The Linux Newbie Guide  ⇒    Fundamentals     Advanced     Supplement   Command Index   ENG⇒中
All rights reserved, please indicate the source when citing
 

locate - Disk Index Search



Thelocate command is a rapid file search tool that doesn't directly search the disk in real-time. Instead, it relies on an index database created by another command called updatedb This index database is typically located at "/var/lib/mlocate/mlocate.db". By utilizing this index, locate quickly finds files.

The command can be combined with wildcards and regular expressions for file searches, and it is extremely fast. Some commonly used options include:



Examples:
$ locate README ←Find files related to 'README'
$ locate -r [[:upper:]] ←Use regular expression to find files with uppercase letters in their names

For more examples and explanations about using the locate command, you can refer to the provided link.