A flexible, command-line pager
Customizing most
In addition to the viewing and navigation features, most
also has extensive customization options. In several instances, these options are set by modifying environmental variables. For example, by default, most
displays with the foreground and background colors set in your terminal. However, if you set most
as your default pager in your environments, the command can display results in color, including on man pages. Enter the commands:
PAGER=most export PAGER
These two commands apply only to the current terminal or tab. To set colors permanently, you must set up a configuration file (see below).
If you want to turn off colors, run most -C
, or open another terminal with t.
Similarly, if you press the E or e key while viewing a file in most
, you can open the file in a text editor. The text editor is defined by adding its name to the definition of the MOST_EDITOR
or SLANG_EDITOR
variable, using the same structure as in defining most
as your system's default pager. If no editor is defined, then most
uses Vim, assuming it is installed.
Perhaps even more useful, you can modify most
's default options by modifying the MOST_SWITCHES
variable. For example, if you want to view all of a line longer than most
's display, you could enter:
define MOST_SWITCHES "-w"
As you might expect, you can override any default using options added at the command prompt.
Other permanent behavioral changes can be made by creating a configuration file. By default, most
does not install with a configuration file, and many users won't likely miss one. However, if you want to configure keybindings or set colors permanently, you can create a system configuration file named /etc/most.conf
, or a personal configuration file named .mostrc
in your home directory.
Before you change an existing keybinding, check the man page to see whether it is already in use. If it is, start the file with a command like:
unsetkey "^KEYSTROKE"
The circumflex (^
) stands for the Ctrl key, which is the command key that most
uses for keybindings. Put the custom keybindings below all the unsetkey
entries in this format:
setkey "PURPOSE" "^KEYSTROKE"
For example, setkey "up" "^P"
will move the cursor up when Ctrl+P is pressed. I have yet to find a list of most
's purposes, but mostly they seem to be common sense.
A configuration file can also be used to set permanent colors using standard ANSI color codes with the command:
color OBJECT-NAME FOREGROUND-COLOR BACKGROUND-COLOR
OBJECT-NAME
can be filled in with status
(for the status line), underline
, overstrike
, or normal
(anything else) (Figure 3).
![](/var/linux_magazin/storage/images/issues/2019/220/command-line-most/figure-3/743041-1-eng-US/Figure-3_large.png)
The Default Linux Should Have
most
was first released in 1999. While many major distributions carry it, it is not installed by default, and I have to wonder why. Part of the reason may be timing. The more popular less
was released when the basic commands were still being developed, so it was easily accepted. By contrast, by 1999, Unix and Linux users were set in their ways, so most
has had a harder time gaining acceptance.
Or, possibly, less
is good enough for most purposes. After all, how often do users add options to less
when piping another command through it?
However, if you make more demanding use of a pager, or simply like to do your computing in your own way, most
's advantages should be more than enough to convince you that less
, like more
, has survived past its prime.
« Previous 1 2
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
![Learn More](https://www.linux-magazine.com/var/linux_magazin/storage/images/media/linux-magazine-eng-us/images/misc/learn-more/834592-1-eng-US/Learn-More_medium.png)
News
-
NVIDIA Released Driver for Upcoming NVIDIA 560 GPU for Linux
Not only has NVIDIA released the driver for its upcoming CPU series, it's the first release that defaults to using open-source GPU kernel modules.
-
OpenMandriva Lx 24.07 Released
If you’re into rolling release Linux distributions, OpenMandriva ROME has a new snapshot with a new kernel.
-
Kernel 6.10 Available for General Usage
Linus Torvalds has released the 6.10 kernel and it includes significant performance increases for Intel Core hybrid systems and more.
-
TUXEDO Computers Releases InfinityBook Pro 14 Gen9 Laptop
Sporting either AMD or Intel CPUs, the TUXEDO InfinityBook Pro 14 is an extremely compact, lightweight, sturdy powerhouse.
-
Google Extends Support for Linux Kernels Used for Android
Because the LTS Linux kernel releases are so important to Android, Google has decided to extend the support period beyond that offered by the kernel development team.
-
Linux Mint 22 Stable Delayed
If you're anxious about getting your hands on the stable release of Linux Mint 22, it looks as if you're going to have to wait a bit longer.
-
Nitrux 3.5.1 Available for Install
The latest version of the immutable, systemd-free distribution includes an updated kernel and NVIDIA driver.
-
Debian 12.6 Released with Plenty of Bug Fixes and Updates
The sixth update to Debian "Bookworm" is all about security mitigations and making adjustments for some "serious problems."
-
Canonical Offers 12-Year LTS for Open Source Docker Images
Canonical is expanding its LTS offering to reach beyond the DEB packages with a new distro-less Docker image.
-
Plasma Desktop 6.1 Released with Several Enhancements
If you're a fan of Plasma Desktop, you should be excited about this new point release.