LinuxCommandLibrary

most

View and scroll through text files

TLDR

Open a file

$ most [path/to/file]
copy

Open several files
$ most [path/to/file1 path/to/file2 ...]
copy

Open a file at the first occurrence of "string"
$ most [path/to/file] +/[string]
copy

Move through opened files
$ <:><n>[<ArrowUp>|<ArrowDown>]
copy

Jump to the 100th line
$ <j>[100]<Enter>
copy

Edit current file
$ <e>
copy

Split the current window in half
$ <CTRL x><o>
copy

Exit
$ <q>
copy

SYNOPSIS

most [options] [+/-]file ...

PARAMETERS

-b
    Suppress boldface rendering.

-c
    Clear the screen before opening each new file.

-d
    Suppress underlining rendering.

-e
    Exit immediately after the last file is reached.

-f
    Enable folding of long lines.

-g
    Display only the first of multiple blank lines.

-i
    Ignore case during search operations.

-m
    Suppress the percentage display in the status line.

-p
    Enable multiple window display, showing as many as fit.

-r
    Raw mode: do not process tabs, backspaces, or other special characters.

-s
    Suppress line wrapping for long lines.

-t
    Use tabs as is, without converting them to spaces.

-u
    Suppress both bold and underline (same as -b and -d).

-w
    Start in 'wrap' mode, wrapping long lines.

-x
    Hex dump mode: display binary files in hexadecimal format.

-z
    Start in 'squeeze' mode, squeezing multiple blank lines.

-C
    Set the color of the status line.

-M
    Set the display mode (0: default, 1: raw, 2: hex).

-S


    Set the section to be displayed (e.g., for man pages).

-T
    Use the specified tag file for navigation.

-Z
    Set the window size to N lines.

+
    Start viewing the file at the specified line number num.

+/pattern
    Search for the specified pattern upon startup.

DESCRIPTION

The most command is a powerful terminal pager designed for viewing text files. Similar to more(1) and less(1), it displays content one screenful at a time, allowing users to scroll forwards and backwards through files. What distinguishes most are its advanced features, including the ability to display multiple windows simultaneously on the screen, which is particularly useful for comparing different sections of a file or different files.

It also excels in handling arbitrarily long lines, ensuring that content is properly displayed without truncation. A unique capability is its hex dump mode, allowing for the inspection of binary files in a hexadecimal format. Furthermore, most supports search functionalities, customizable display options like bold/underline suppression, and various modes for different viewing needs, making it a versatile tool for system administrators and developers alike.

CAVEATS

While powerful, most is less commonly pre-installed than less(1) or more(1) and may require separate installation. Its multi-window interface, while unique, might have a steeper learning curve for users accustomed to simpler pagers.

MULTI-WINDOW DISPLAY

One of most's standout features is its ability to display multiple windows simultaneously. This allows users to view different parts of the same file or even different files side-by-side, enhancing productivity for comparison or cross-referencing tasks. Activated with the -p option, it automatically adjusts the number of windows based on screen size.

HEX DUMP MODE

For developers and system administrators, most provides a dedicated hex dump mode (-x option). This allows binary files to be viewed in a hexadecimal representation, complete with ASCII interpretations, making it invaluable for debugging, analyzing file formats, or inspecting non-textual data directly within the terminal.

LONG LINE HANDLING

Unlike some pagers, most excels at displaying arbitrarily long lines without truncation. It can be configured to wrap long lines (-w) or display them without wrapping (-s), offering flexibility for source code, log files, or other content with extensive line lengths.

HISTORY

The most pager was developed by John E. Davis as an alternative to existing pagers like more(1) and less(1), aiming to combine their best features while adding unique capabilities. Its development, originating in the early 1990s, focused on providing robust handling of long lines, advanced search, and the distinctive multi-window and hex-dump functionalities that set it apart. It has been maintained over the years, offering a specialized tool for advanced text and binary file viewing.

SEE ALSO

less(1), more(1), cat(1), grep(1)

Copied to clipboard