Search and Filtering

locate

Finds files quickly from a filename database.

locate searches a prebuilt database instead of walking the filesystem live. It is fast but may miss very new files until the database updates.

Syntax
locate [options] pattern

Arguments explained

  • pattern is a filename fragment or glob.
  • -i ignores case.
  • -n limits the number of results.

Common examples

Find ssh config paths
locate sshd_config

Searches the locate database for matching paths.

Limit results
locate -n 10 bashrc

Shows only the first ten matches.

locate Command
FieldDetails
Commandlocate
CategorySearch and Filtering
Primary useFinds files quickly from a filename database.
Syntaxlocate [options] pattern