man displays the manual page for a command, library function, system call, or config file. Manual pages are the canonical reference for Unix tools and are installed locally, so they work offline. They are organised into numbered sections: 1 user commands, 2 system calls, 3 library functions, 5 file formats, 8 sysadmin commands, and a few others.
man ls # manual for ls
man 2 open # open() system call (section 2)
man 5 passwd # /etc/passwd format (section 5)
man -k keyword # search page names and descriptions
man -f passwd # one-line summary from each section
Inside man, navigation is the same as less: space or f for next page, b for back, /pattern to search, q to quit. Every serious Linux user develops the reflex of reaching for man before the search engine.
Related terms: less, info
Discussed in:
- Chapter 5: The Shell — Getting Help