What is the Linux man Command?

The man command in Linux is shorthand for "manuals" and provides a way to access user manuals for command-line tools/utilities.


man Syntax

The man command takes an optional list of flags followed by the name of the command.


man [OPTION...] [Command]


To explore the full list of flags available in man, use the following command:


man -h


Read a Manual with man

Let's say we want to learn about the grep command from the terminal. We would type the following:


man grep


A formatted manual will appear showing you everything about grep, which can be scrolled through using the UP/DOWN arrow keys.


Grep manual screenshot


When you have finished reading press Q to close the manual.


Find the Definition of Any Command Utility

If you just want a short definition of what any command-line utility is, use the -f flag in the man command. To demonstrate this, let's see what the printf command is:


man -f printf
printf (1)      - format and print data
printf (3)      - formatted output conversion