Dit deel is nog niet vertaald. Je ziet de Engelse tekst.
$ als gewone gebruiker# als root (of met sudo)
Vaardigheden in dit hoofdstuk
- Antwoorden vinden in man-pagina's, info en /usr/share/doc
Read a man page
man COMMAND opens the manual page of a command, a file or a function. It shows the syntax, every option and often examples.
man ls
man passwd
man 5 passwd
man -f passwd
passwd (1) - update user's authentication tokens
passwd (5) - password fileA man page has fixed parts:
| Part | What you find there |
|---|---|
| NAME | The name and one line about it |
| SYNOPSIS | The syntax. [ ] = optional, … = may repeat, | = choose one |
| DESCRIPTION | What it does, then the options |
| EXAMPLES | Ready command lines (not in every page) |
| FILES | Files the program reads or writes |
| SEE ALSO | Related pages — a good path to more help |
Keys inside man (they come from the pager less):
| Key | What it does |
|---|---|
Space / b | One page down / up |
/word then Enter | Search forward; n = next match, N = previous |
g / G | Go to the start / the end |
h | Help with all keys |
q | Quit |
Examentip
Search the man page for EXAMPLE with /EXAMPLE. Many pages (for example man nmcli-examples, man 5 crontab) have ready lines you can copy.
Know the man page sections
The manual is split into numbered sections. The same name can exist in more sections — the number picks the right page.
| Section | What is in it | Example |
|---|---|---|
| 1 | Commands for all users | man 1 passwd |
| 5 | File formats and config files | man 5 passwd, man 5 fstab |
| 8 | Admin commands (mostly for root) | man 8 useradd |
| 2, 3 | Kernel calls and library functions (for programmers) | man 3 printf |
| 7 | Overviews and standards | man 7 regex, man 7 signal |
man -a shows all pages with that name, one after the other.
Onthoud
The number in passwd(5) is the section. Use it like this: man 5 passwd.
Search the manual by keyword
When you do not know the command name, search the short descriptions: man -k WORD (same as apropos WORD).
man -k partition
fdisk (8) - manipulate disk partition table
gdisk (8) - Interactive GUID partition table (GPT) manipulator
parted (8) - a partition manipulation program
partprobe (8) - inform the OS of partition table changes
man -k '^user' | grep '(8)'
useradd (8) - create a new user or update default new user information
userdel (8) - delete a user account and related files
usermod (8) - modify a user account
apropos -s 5 sshThe search uses a database. If man -k finds nothing, or a new package is not found, build the database again:
Let op
man -k only searches the NAME line. Search for simple words: "partition", "password", "time zone".
Use --help and the shell's own help
Most commands print a short list of options with --help. Commands built into Bash (like cd) use help instead.
ls --help | less
nmcli connection modify --help
systemctl --help | grep -i enable
type cd
cd is a shell builtin
help cd
help -d export
export - Set export attribute for shell variables.Op het werk
--help is faster than man when you only forgot one option. Pipe it into grep to find the line: rsync --help | grep -- --delete.
Read info pages
Some GNU tools have longer guides as info pages, with chapters and links.
Use the Red Hat documentation online
When the local help is not enough, Red Hat has full guides and a knowledge base.
docs.redhat.com— the product documentation for RHEL 10: installation, networking, storage, security … Free for everybody.- Red Hat Customer Portal (
access.redhat.com) — knowledge-base articles and solutions for real problems; many need an account (the free developer account works). - RHEL Lightspeed — ask questions in plain words on the command line. See Get AI help with RHEL Lightspeed.