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.
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 viewDiscovers 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 viewOpens the ls manual. Press q to quit.
Run from ~/linux-practice
man ls Optional locate setup
Optional adminInstalls 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
- Use whatis tar and apropos compress.
- 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.
- Which command tells whether cd is a builtin?
- How do you quit man?
Your practice, your pace
Loading saved progress…