Refresh the locate database to find files instantly and control what gets indexed. 23.05.2026 | reading time: 2 min What does `updatedb` do? It scans filesystem paths and writes a compact filename database that `locate` queries for near-instant file lookup; run it manually or let the system update it on a schedule to keep search results current. Quick hands-on example Run a manual update and then search: ```sh $ sudo updatedb $ locate secrets.txt /home/admin/projects/secret-reports/secrets.txt ``` This shows the two-step workflow: build the database, then query it with `locate` for instant results. Tame what gets indexed Edit `/etc/updatedb.conf` or use options to exclude noisy paths; common knobs are PRUNEPATHS and PRUNEFS to skip directories like /tmp or filesystems such as proc, and you can use `updatedb --output=FILE` or override `--localpaths` and `--netpaths` to control scope when needed. Performance, security, and scheduling A full `updatedb` run touches many inodes and can cause I/O load, so schedule it via cron or a systemd timer during low activity; be mindful that running as root produces a comprehensive database, so restrict access to the database file and consider running updates as a less-privileged user to limit exposure. When `locate` is not enough For content searches or complex predicates use `find` or ripgrep; `updatedb` plus `locate` is about speed for names, while `find` performs live scans and supports rich tests and actions. Wrap-up and next step Use `updatedb` to make filename lookups instantaneous, tune `/etc/updatedb.conf` to avoid noise, and automate updates for reliable results; explore deeper Linux tooling and consider exam preparation like CompTIA Linux+ or LPIC-1 with intensive courses at bitsandbytes.academy to turn these skills into certification. Join Bits & Bytes Academy First class LINUX exam preparation. filesystem utilities setup scripting