Basics

Linux man command

Open the manual page for a command. Press q to leave the viewer.

Availability: Common Linux commands; shell built-ins and external implementations may differ by distribution.中文

Syntax

man [OPTION]... [[SECTION] PAGE ...]

Examples

Open the manual page for ls.

man ls

Open section 5 documentation for the passwd file format.

man 5 passwd

Parameters, options and clauses

Option / clauseDescription
-k KEYWORDSearch manual page names and descriptions (apropos).
-f PAGEShow a short description of a manual page (whatis).
-a PAGEShow all matching manual pages, one after another.
-K TEXTSearch the full text of manual pages.
-w PAGEPrint the location of the manual page file.
-M PATHUse PATH as the manual page search path.
Safety note

Review a command and its target before running it. Commands that alter files, services, accounts, disks, permissions or databases may be difficult to reverse. Test in a safe environment and keep backups.

Official reference ↗Back to directory