Mission 28 of 30

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.

35–45 min Week 4 · Scripting, scheduling, customization, final project Ubuntu terminal
Your outcome: You can answer many Linux questions from the system itself.
Practice inside ~/linux-practice. Check your setup before you begin. Prerequisite: Scheduling Without Breaking Your Crontab .

What you’ll practice

  • Use command lookup tools
  • Read man/whatis/apropos
  • Understand locate as optional

The mental model

  • 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.

Try it in your terminal

Find command info

Read-only system view

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

Run from ~/linux-practice

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

Manual pages

Read-only system view

Opens the ls manual. Press q to quit.

Run from ~/linux-practice

man ls

Optional locate setup

Optional admin

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

Run from advanced users only

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

Put it into practice

  1. Use whatis tar and apropos compress.
  2. Open man grep and search inside it with /pattern.

Check your result

You find an option and example using built-in help.

Common mistakes

  • You read a blog post that says 'install locate to find files fast,' so you install it. But `find ~/linux-practice -name '*.txt'` already does what you need. Install tools when you've outgrown the built-in ones, not before.
  • You open `man ls`, feel overwhelmed by the wall of text, and press random keys trying to escape. Press `q` to quit. Press `/` then type a word to search. Press `n` for the next match. Man pages are documentation, not a trap.

Check your understanding

Explain these in your own words. If you’re unsure, revisit the examples before moving on.

  1. Which command tells whether cd is a builtin?
  2. How do you quit man?

Your practice, your pace

Loading saved progress…

Discussion

Continue the conversation about this guide. Loading comments connects to GitHub Discussions through giscus.

Open community discussions on GitHub

Check before you copy

This command needs care. Read its context, confirm the target and location, and keep a recovery path.

Copying does not run a command.