man's Examples

This command is used to view the on-line reference manual pages for commands/programs.

$ man grep
$ man mkdir

No Option: It displays the whole manual of the command.

Example: 

$ man printf

$ man [COMMAND NAME]

Section-num: Since a manual is divided into multiple sections so this option is used to display only a specific section of a manual.

Example:

$ man 2 intro

$ man [SECTION-NUM] [COMMAND NAME]

-f option: 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.

Example:

$ man -f ls

$ man -f [COMMAND NAME]

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

$ man -a [COMMAND NAME]

-k option: This option searches the given command as a regular expression in all the manuals and it returns the manual pages with the section number in which it is found.

$ man -k [COMMAND NAME]

-w option: This option returns the location in which the manual page of a given command is present.

Example:

$ man -w ls

$ man -w [COMMAND NAME]

-I option: It considers the command as case sensitive.

$ man -I [COMMAND NAME]

Format the manual page for bash into the default troff or groff format and pipe it to the printer named ps. The default output for groff is usually PostScript. man --help should advise as to which processor is bound to the -t option.

man -t bash | lpr -Pps

This command will decompress and format the nroff source manual page ./foo.1x.gz into a device independent (dvi) file. The redirection is necessary as the -T flag causes output to be directed to stdout with no pager. The output could be viewed with a program such as xdvi or further processed into PostScript using a program such as dvips.

man -l -Tdvi ./foo.1x.gz > ./foo.1x.dvi

Lookup the manual pages referenced by smail and print out the short descriptions of any found. Equivalent to whatis smail.

man -f smail

DevOpsSchool
Typically replies within an hour

DevOpsSchool
Hi there 👋

How can I help you?
×
Chat with Us