Skip to main content

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

 

This article was first seen on ComTek's "TekBits" Technology News

HOME