Indexed Search & Command Introspection (locate, whereis, type)
Concept & Overview
When find is too slow because it scans the live disk tree, and you need to inspect command binaries vs shell builtins:
- sudo updatedb: Crawls the entire filesystem and builds a high-speed precomputed search index database (mlocate.db).
- locate : Instantly searches the indexed database in milliseconds instead of seconds.
- whereis : Locates binary executables, source files, and man pages in standard system paths.
- type : Identifies whether a command is a shell builtin (e.g. cd, umask), an alias (e.g. ll), or an external binary disk file (e.g. /bin/ls).
sudo updatedb, locate files with locate nginx, check binary paths with whereis nginx, and test command types using type cd and type ls.Command Syntax Reference
| Command / Syntax | Description |
|---|---|
sudo updatedb | Generate or update the fast mlocate search index database |
locate nginx | Instantly find all paths containing nginx via database |
whereis nginx | Find binary, source, and manual page locations |
type cd / type ls | Determine whether a command is a shell builtin or binary file |
Verification Objectives
These conditions will be automatically verified when you run commands inside the interactive terminal simulator:
- ○Run sudo updatedb to build index
- ○Run locate to find indexed files
- ○Run whereis to locate command files
- ○Run type to introspect command nature
Ready to complete Quest 86?
Test your skills live in the browser terminal with an emulated Linux filesystem, real-time command evaluation, and instant step-by-step hints.