Linux command: man
Find instructions for a command
Suppose you have heard of the ls command but do not know what its options do. The man command opens a local reference page for software installed on the system, usually in a pager, a program that lets you read a long page a screen at a time. The general form is man command, where command is the name of the page you want. For example, man ls opens the manual page for ls. Manual pages cover commands, programming interfaces, file formats, and other system topics.
man ls
Pages are grouped into numbered sections. Section 1 covers user commands, 2 system calls, 3 library functions, 5 file formats and configuration, 7 conventions and overviews, and 8 system-management commands. The same name can appear in several sections. printf may refer to a shell command or a C library function, so select the page with man 1 printf or man 3 printf:
man 1 printf
man 3 printf
Similarly, man 5 passwd describes the passwd file format, not a command with the same name. The number chooses a section; it is not part of the page name.
When you do not know a page name, man -k keyword searches page names and their short descriptions. On man-db systems, apropos keyword performs the same kind of search. For example:
man -k archive
This searches the index, not every line of every manual page. Results may be incomplete if the local index is missing or out of date. man -f printf asks for a one-line description, as does whatis on systems that provide it. Check man man for options supported by the local implementation.
A page often has sections named NAME, SYNOPSIS, DESCRIPTION, OPTIONS, EXAMPLES, and SEE ALSO. The synopsis shows accepted command forms. Brackets mark optional syntax; an ellipsis usually means an argument can repeat. These are notation conventions, not text to type. Read the relevant option and compare its example with your task. A local page may describe the installed version more accurately than a manual for another release.
The pager comes from system configuration or the environment. In less, press q to exit, /word to search forward, and n to move to the next match. Another pager may use different keys. If a topic is unavailable, its documentation package may not be installed, or the information may be under another section or in a separate project guide.
For an unfamiliar option, choose the page section that matches the subject, read the synopsis, then inspect the option and examples. man -k archive can find likely page names when you do not know the command; treat a keyword result as a starting point and verify the page before using its command.









