Unix / Linux: Display Color Man Pages

How do I add a bit of color to my man pages under Linux / FreeBSD / Apple OS X / Unix like operating systems?

You can install a pager called most. It is a paging program that displays, one windowful at a time, the contents of a file on a terminal. It pauses after each windowful and prints on the window status line the screen the file name, current line number, and the percentage of the file so far displayed.

How Do I Install most Under FreeBSD unix?

To install the port, enter:
# cd /usr/ports/sysutils/most/
# make install clean

Alternatively, you can add the binary package called most using the the following command:
# pkg_add -r most
Newer version of FreeBSD user should use the pkg command:
# pkg install most

How Do I Install most Under Debian / Ubuntu Linux?

Type the following apt-get command or apt command:
$ sudo apt-get install most
OR
$ sudo apt install most

How Do I Install most Under Fedora / RHEL / SL / CentOS Linux?

Make sure EPEL repo is configured on a CentOS/RHEL based system. Type the following yum command to install the same:
# yum install most
Fedora Linux user should type the following dnf command:
$ sudo dnf install most

How Do I Use most Command?

Type the following command to set PAGER bash shell variable, enter:

export PAGER="most"

OR

export PAGER="/usr/bin/most -s"

I recommend that you modify and setup environment variable called PAGER in ~/.bashrc file.

A Note About CSH / TCSH Shell Users

CSH / tcsh shell users, type the following command:

setenv PAGER /usr/local/bin/most

Try viewing man for any command. To view the man page of Linux date command, enter:
$ man date
Sample outputs:

Fig.: Unix / Linux: Color man pages with most command

most Command Summary

Quitting:

  Q                      Quit MOST.
  :N,:n                  Quit this file and view next.
                            (Use UP/DOWN arrow keys to select next file.)

Movement:

  SPACE, D              *Scroll down one Screen.
  U, DELETE             *Scroll Up one screen.
  RETURN, DOWN          *Move Down one line.
  UP                    *Move Up one line.
  T                      Goto Top of File.
  B                      Goto Bottom of file.
  > , TAB                Scroll Window right
  <                      Scroll Window left
  RIGHT                  Scroll Window left by 1 column
  LEFT                   Scroll Window right by 1 column
  J, G                   Goto line.
  %                      Goto percent.

Window Commands:

  Ctrl-X 2, Ctrl-W 2     Split window.
  Ctrl-X 1, Ctrl-W 1     Make only one window.
  O, Ctrl-X O            Move to other window.
  Ctrl-X 0               Delete Window.

Searching:

  S, f, /               *Search forward
  ?                     *Search Backward
  N                     *Find next in current search direction.

Miscellaneous:

  W                      Toggle width between 80 and 132 char mode.
  Ctrl-X Ctrl-F          Read a file from disk
  R, Ctrl-R              Redraw Screen.
  F                      Simulate tail -f mode
  :o                     Toggle options:  b-binary, w-wrap, t-tab
  E                      Edit file.  Uses MOST_EDITOR and EDITOR
                           environment variables.

*Note:  This command may be repeated `n' times By entering a number then
        the command key, e.g.,  '5 SPACE' moves 5 screens forward.
  • Download most paging program for Unix, VMS, MSDOS, and win32 systems.

This entry is 1 of 2 in the Linux / UNIX Colorful Man Pages Tutorial series. Keep reading the rest of the series:

  1. Unix / Linux: Display Color Man Pages
  2. Linux / Unix: Colored Man Pages With less Command

This entry is 3 of 5 in the Installing and Using Man Pages Tutorial series. Keep reading the rest of the series:

  1. How to add/install man pages in Alpine Linux
  2. How to install man pages on a CentOS Linux 6/7
  3. Unix / Linux: Display Color Man Pages
  4. Linux / UNIX: Getting help with man pages and how to use them
  5. HowTo: Linux / UNIX Create a Manpage

Posted by: SXI ADMIN

The author is the creator of SXI LLC and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

Total
0
Shares
Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post

How to Make Website WCAG Compliant?

Next Post

Link download Kali Linux 2020.1 (ISO + Torrent)

Related Posts