Suggested day 2820–30 minutesOptional admin

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.

Outcome: You can answer many Linux questions from the system itself.

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

1

Find command info

Read-only

Discovers command locations, shell builtins, and descriptions. Prefer command -v over which in scripts because command is provided by the shell.

Terminal
command -v ls
command -V cd
whereis bash
type cd
whatis ls
apropos 'list directory' | head -10
2

Manual pages

Read-only

Opens the ls manual. Press q to quit.

Terminal
man ls
3

Optional locate setup

Admin

Installs plocate (the modern locate on Ubuntu 22.04+) and updates its database. Optional only.

Terminal
sudo apt install plocate -y
sudo updatedb
locate bashrc | head

Checkpoint

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?

Shortcuts:Alt + ← previous lessonAlt + → next lessonAlt + H home? focus search