locate
searches a prebuilt database to find files matching a pattern
TLDR
Find files by pattern
$ locate "[pattern]"
Find case-insensitivecopy
$ locate -i "[pattern]"
Find by exact filename (basename only)copy
$ locate -b "\[filename]"
Limit output to a specific number of resultscopy
$ locate -l [10] "[pattern]"
Count the number of matching entriescopy
$ locate -c "[pattern]"
Display database statisticscopy
$ locate -S
Update the databasecopy
$ sudo updatedb
copy
SYNOPSIS
locate [options] pattern...
DESCRIPTION
locate searches a prebuilt database to find files matching a pattern, making it much faster than find for simple filename searches. The database is typically updated daily by a cron job.
PARAMETERS
-i, --ignore-case
Case-insensitive search-l, --limit N
Limit output to N entries-c, --count
Print count of matches-e, --existing
Only print existing files-b, --basename
Match only basename-r, --regexp
Use basic regex pattern--regex
Use extended regex pattern-d, --database DBPATH
Search in specified database instead of the default-S, --statistics
Print statistics about each database and exit-w, --wholename
Match against the whole path name (default behavior)
CAVEATS
Database is updated periodically, so recently created files may not be found. Run `updatedb` to refresh the database manually.