Find filenames in an instant by searching a maintained database instead of crawling the whole disk. 03.04.2026 | reading time: 2 min Ever lost a configuration file on a Linux server and need it now The `locate` command returns matching filenames almost instantly by consulting a periodically updated filename database instead of scanning every directory on demand. Find it now Try this on a machine with mlocate installed ```bash $ sudo updatedb $ locate sshd_config /etc/ssh/sshd_config /usr/share/doc/openssh/sshd_config.example /var/lib/alternatives/ssh/sshd_config ``` This example shows updating the database and returning hits in a fraction of a second. Power features A few practical options change how locate behaves for real work: use `sudo updatedb` to refresh the database, limit results with `-n` to get the first matches, use `-i` to ignore case and `-r` to treat the pattern as a regular expression, and consider `-e` to report only entries that still exist; note that the database file is usually under /var/lib/mlocate and is maintained by a cron job or systemd timer and can be configured to exclude sensitive paths. Nearby tools When you need up-to-the-second results use `find`, for faster interactive searches try `fd`, and remember `updatedb` is the service that keeps locate useful; each tool has a clear role and they complement one another in real workflows. Where to go next Mastering locate makes routine searches trivial and saves time; explore its options, check your distribution's updatedb configuration for privacy, and build this skill into scripts and troubleshooting routines to become more effective on Linux, then consider deepening your knowledge with certifications such as CompTIA Linux+ or LPIC-1 and intensive exam preparation at bitsandbytes.academy. Join Bits & Bytes Academy First class LINUX exam preparation. filesystem utilities troubleshooting