man

man linux command cheatsheet by Thamizhiniyan C S

Introduction

The man command is used to display the command / program's documentation / manual page.


Syntax

man [man options] [[section] page ...] ...
man -k [apropos options] regexp ...
man -K [man options] [section] term ...
man -f [whatis options] page ...
man -l [man options] file ...
man -w|-W [man options] page ...

Sections of the man page

SectionContents of the section

1

User commands

2

Programming interfaces for kernel system calls

3

Programming interfaces to the C library

4

Special files such as device nodes and drivers

5

File formats

6

Games and amusements such as screen savers

7

Miscellaneous

8

System administration commands

Important Flags

FlagDescription

-f, –whatis

Display a concise one-line description of the command.

-k, –apropos

Search for commands related to a given keyword.

-a, –all

Display all matching manual pages for the specified command.

Spacebar

Move forward one page in the manual.

Enter

Move forward one line in the manual.

B

Move backward one page in the manual.

Q

Quit the manual viewer.


Examples

CommandDescription
man [SECTION-NUM] [COMMAND NAME]

In the man command manuals, sections are used to categorize different types of information. You can specify a section number to display only the relevant section of a manual.

man -f [COMMAND NAME]

One may not be able to remember the sections in which a command is present. So this option gives the section in which the given command is present.

man -a [COMMAND NAME]

This option helps us to display all the available intro manual pages in succession.

man -k [COMMAND NAME]

The -k option in the man command allows you to search for a command as a regular expression across all manual pages, returning a list of matching entries along with their section numbers.

man -w [COMMAND NAME]

The -w option in the man command returns the location of the manual page for a given command. This is useful for finding where the manual pages are stored on the system.

man -I [COMMAND NAME]

The -I option in the man command makes the search case-sensitive, ensuring that the command name is considered with exact case.

man cd

To view the Manual for “cd” Command Using man Command

man -k file

Searching for Commands Related to “file” Using man Command

man -f ls

To Display a One-Line Description of “ls” Using man Command

Last updated