The Man Command in GNU/Linux

Mike Turcotte-McCusker
Aug 5, 2017
Updated • Jul 31, 2017
Linux
|
6

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?

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
Advertisement

Previous Post: «
Next Post: «

Comments

  1. 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.

  2. 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?

  3. 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

  4. 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

Leave a Reply

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

We love comments and welcome thoughtful and civilized discussion. Rudeness and personal attacks will not be tolerated. Please stay on-topic.
Please note that your comment may not appear immediately after you post it.