Mission 3 of 5
Locating Files and Reading Documentation
Use built-in documentation to investigate an unfamiliar command.
Use command discovery and manual pages before installing extra search databases.
Mental model
Understand what is happening
which, whereis, and type answer different command-location questions.
man pages are built-in documentation.
locate may require a system database update, so it is optional.
Guided lab
Work through the mission
Find command info
Discovers command locations, shell builtins, and descriptions. Prefer command -v over which in scripts because command is provided by the shell.
command -v ls
command -V cd
whereis bash
type cd
whatis ls
apropos 'list directory' | head -10Manual pages
Opens the ls manual. Press q to quit.
man lsOptional locate setup
Installs plocate (the modern locate on Ubuntu 22.04+) and updates its database. Optional only.
sudo apt install plocate -y
sudo updatedb
locate bashrc | headCheckpoint
Verify the mission
You find an option and example using built-in help.
Try it yourself
One step without a recipe
Use whatis tar and apropos compress. Open man grep and search inside it with /pattern.
Need a hint?
Before you install anything extra, try `man command-name` and search with `/pattern` inside the page. The answer is usually already on your system. You paid for this documentation when you installed Linux — might as well use it.
Explain it back
Before you move on
- Which command tells whether cd is a builtin?
- How do you quit man?