Get Help in the GNU/Linux Shell

There are typically tens of thousands of programs collected in a GNU/Linux distribution. Each program has several options. It is hard for one to remember them all. In our Essential GNU/Linux Commands series, we have tried to introduce only the most commonly used commands and their options.


--help

Many programs (commands) have the option "--help" or "-h" for displaying help messages. Some programs' "--help" option is for help messages but "-h" is not, so we recommend to always use "--help". We can always check the help messages in the command line. The help messages often contain usage (syntax) of the command and options with explanations.

For example,

ls --help
displays the help messages for the command "ls".


man

We can also get the manual pages of a program which is more detailed, by running

man COMMAND

For example,

man ls
displays the manual page for the command "ls".

To exit, press "q".


info

We can also get the info pages of a program which is also more detailed, by running
info COMMAND

For example,

info ls
displays the info page for the command "ls".

Use "info" alone to start reading from the content pages of "info".

To exit, press "q".


"--help" vs "man" vs "info"

In terms of details:
--help ≤ man ≤ info

We recommend to read the help messages first, if you still need more information, choose either the manual pages or the info pages.


Related

Comments

Popular

Intel 7th and 8th generation processor graphics driver for Windows 7/8/8.1

AV1 vs VP9 vs AVC (h.264) vs HEVC (h.265): Part II - Fidelity

AV1 vs VP9 vs AVC (h.264) vs HEVC (h.265): Part I - Lossless

AV1 vs VP9 vs AVC (h.264) vs HEVC (h.265): Part IV - Decode

OBS Studio settings for best quality (loseless) recording

AV1 vs VP9 vs AVC (h.264) vs HEVC (h.265): Part III - Quality

Install VMAF on Fedora, CentOS/Red Hat (RHEL)