The Man Command in GNU/Linux - gHacks Tech News

The Man Command in GNU/Linux

GNU/Linux is powerful. GNU/Linux is mighty. GNU/Linux can be confusing…

One of the things that terrifies most people about GNU/Linux is the command line. Granted, most users can get away with never touching a terminal window nowadays on most modern distributions, but when a lot of people think of GNU/Linux they instantly picture a command line interface of scrolling text and gibberish code.

Thankfully, learning to actually use the command line is not quite as daunting as one might assume, especially with the help of something known as the Man Pages.

Have you ever heard of the acronym, “RTFM,” or “Read the freakin’ manual?” It’s commonly thrown around by GNU/Linux power users who don’t feel like helping a new user out with simple questions. Often when they refer to ‘the manual,’ they are referring to the Man Pages.

But what ARE the Man Pages?

man commands

Simply put, the Man Pages are documentation or a manual for various commands used in the command line environment. Many commands, programs/applications and tools have various “options” that can be utilized; the Man Pages are an absolutely invaluable tool for learning what these various options are and how to better use the command line to suit your needs.

How to use the man command

The syntax of the man command is very straightforward and easy to learn to use:

man [options] (keywords)

More often than not people will not even use options when they use the man command, simply just using man and then the keyword only.

man nano

When using the man command, more often than not the output is automatically pushed through a program called "Less", which allows you to view the output one page at a time in fullscreen. Once you have pulled up the man page for the program or application you are looking into, you can press "H" to view help text which will give you a list of hotkeys to press to navigate through "Less."

Some examples taken directly from the help page of Less are:

  • Commands marked with * may be preceded by a number, N.
  • Notes in parentheses indicate the behavior if N is given.
  • A key preceded by a caret indicates the Ctrl key; thus ^K is ctrl-K.
  • h H Display this help.
  • q :q Q :Q ZZ Exit.
  • e ^E j ^N CR * Forward one line (or N lines).
  • y ^Y k ^K ^P * Backward one line (or N lines).
  • f ^F ^V SPACE * Forward one window (or N lines).
  • b ^B ESC-v * Backward one window (or N lines).
  • z * Forward one window (and set window to N).
  • w * Backward one window (and set window to N).
  • ESC-SPACE * Forward one window, but don't stop at end-of-file.
  • d ^D * Forward one half-window (and set half-window to N).
  • u ^U * Backward one half-window (and set half-window to N).
  • ESC-) RightArrow * Left one half screen width (or N positions).
  • ESC-( LeftArrow * Right one half screen width (or N positions).
  • F Forward forever; like "tail -f".
  • ESC-F Like F but stop when search pattern is found.
  • r ^R ^L Repaint screen.
  • R Repaint screen, discarding buffered input.

Final words

The Man Pages are an absolutely invaluable asset as stated before, for learning how to use a text only interface in the GNU/Linux world. If ever you are wanting to learn more, or finding trouble with running programs and applications, alway

Summary
The Man Command in GNU/Linux
Article Name
The Man Command in GNU/Linux
Description
Mike walks you through the steps of making use of the man (manual) command on GNU/Linux machines when running commands from the Terminal.
Author
Publisher
Ghacks Technology News
Logo

We need your help

Advertising revenue is falling fast across the Internet, and independently-run sites like Ghacks are hit hardest by it. The advertising model in its current form is coming to an end, and we have to find other ways to continue operating this site.

We are committed to keeping our content free and independent, which means no paywalls, no sponsored posts, no annoying ad formats or subscription fees.

If you like our content, and would like to help, please consider making a contribution:

Comments

  1. cotter said on August 5, 2017 at 6:53 pm
    Reply

    The meaning of RTFM stated in the article is incorrect…

    1. Anonymous said on August 5, 2017 at 11:02 pm
      Reply

      0.o maybe Mike is considering ghacks is not 18+?!? Not sure exactly when it started but we are no doubt long into a new era en.wikipedia.org/wiki/RTFM

  2. mikef90000 said on August 6, 2017 at 2:43 am
    Reply

    Don’t forget the complementary command ‘info’. More documentation is sometimes available this way.
    Usage example: info mount

  3. Anonymous said on August 6, 2017 at 3:15 pm
    Reply

    “One of the things that terrifies” me about Linux, is the professional advices of its communauty. I was advised as email box to use OpenMailbox, and now since the recent f*****g changes without any warning, I have been taken hostage, I can’t even remove my account, the owner has locked the button! I really would like on Ghacks to read an article on that subject, OpenMailbox :(((

    1. kalmly said on August 6, 2017 at 3:52 pm
      Reply

      Agghhh. No warning? Dead email? Can’t do things? Sound like Windows.

      What always scares me about Linux is what happens if you make a typo? It looks like it would be real easy to kill your machine, or if you only injured it, how would you ever find the wound so you could heal it?

  4. Hank Mike said on December 17, 2017 at 2:55 am
    Reply

    To my mind, the most valuable option to man is -k xyz. What it does is to search the program names and the program descriptions, and display a list which consists of all the program names containing the string “xyz” and all the program descriptions containing the string “xyz”. If no program or description has the string “xyz”, the response will be “xyz: nothing appropriate.” Hint: use “more” or “less” to read the list easily. Sample command:
    man -k link | more

    I used and programmed with Linux for several years before I found the -k option.

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

Please note that your comment may not appear immediately after you post it.