MOST(1)

πŸ“¦
version 5.2.0 Β· 3 versions
, in alpine 3.24, arch rolling, debian trixie, epel 10, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ‘‘ most(1) πŸ‘‘ β€” the manual page, bestie edition

okay so you opened the MOST(1) man page and you want the tea. good. we're doing this properly, no skipping, no summarising, every flag stays. let's go πŸ’–


πŸ“› NAME πŸ“›

most β€” browse or page through a text file. that's it. that's the whole job. and it does it iconically.


✨ SYNOPSIS ✨

most [ -1 ] [ -b ] [ -C ] [ -c ] [ -d ] [ -M ] [ -r ] [ -s ] [ -t ] [ -u ] [ -v ] [ -w ] [ -z ] [ +/string ] [ +line-number ] [ +d ] [ +s ] [ +u ] [ file... ]

πŸ’… DESCRIPTION πŸ’…

so most is a paging program β€” meaning it shows you the contents of a file on your terminal, one windowful at a time. after each windowful it pauses, and it prints on the window status line the screen, the file name, the current line number, and the percentage of the file you've seen so far. very "where am i in this document" of it. slay.

and here's where it eats and leaves no crumbs: unlike other paging programs, most can display an arbitrary number of windows as long as each window takes up at least two screen lines. each window can hold the same file or a different file. and every window has its own mode, like fr fr β€” one window might display a file with its lines wrapped, while another might be truncating the lines. windows may be locked together, meaning if one of the locked windows scrolls, all the locked windows scroll. it's giving synchronized swimming. πŸ¦‹

most can also straight up ignore lines that are indented beyond a value you specify. super useful when you're viewing computer programs and you just want the gross features of the code, not every nested little detail. go read the :o command below for the full description of that feature.

and it's not just plain text files either β€” most can display binary files as well as files with arbitrary ascii characters. when a file gets read into a buffer, most examines the first 32 bytes of the file to figure out if it's a binary file, and then it switches to the appropriate mode. that said, you can disable this whole thing with the -k option. see the descriptions of -b, -k, -v, and -t for more.

text files may contain combinations of underscore and backspace characters β€” the kind of thing that makes a printer underline or overstrike. when most recognizes that, it inserts the appropriate escape sequences to get the effect you want. also, some files cause the printer to overstrike some characters by embedding carriage return characters in the middle of a line. when that happens, most displays the overstruck character with a bold attribute. this is what makes reading UNIX man pages or a document produced by runoff actually pleasant. in particular, viewing this document with most should illustrate this behavior, provided the underline characters haven't been stripped. you can turn it all off with -v.

by default, lines with more characters than the terminal width are not wrapped β€” they get truncated instead. when truncation happens, it's indicated by a $ in the far right column of the terminal screen. the RIGHT and LEFT arrow keys let you view lines that extend past the margins of the screen. the -w option overrides this whole feature. and when a window is wrapped, the character \ will appear at the right edge of the window. πŸ’€

commands are listed below. πŸ‘‡


🌈 COLOR SUPPORT 🌈

most has supported both 256-color and 24 bit truecolor terminals since version 5.2. not all terminals are capable of generating arbitrary 24 bit colors though. so if your terminal does support 24 bit colors, but most doesn't detect it, then set the environment variable

COLORTERM=truecolor

to force 24 bit truecolors to be used. easy. ✨


πŸŽ€ OPTIONS πŸŽ€

  • -1 β€” VT100 mode. this is only meaningful on VMS systems, okay? use this option if your terminal is strictly a VT100. it implies the terminal doesn't have the ability to delete and insert multiple lines. VT102s and above do have that ability, so they don't need this.
  • -b β€” Binary mode. use this switch when you want to view files containing 8 bit characters. most will display the file 16 bytes per line in hexadecimal notation. a typical line looks like:
01000000 40001575 9C23A020 4000168D     ....@..u.#. @...

when used with the -v option, that same line looks like:

^A^@^@^@  @^@^U u 9C #A0    @^@^V8D     ....@..u.#. @...
  • -C β€” Disable color support. sorry to the color lovers. πŸ™ˆ
  • -c β€” Make searches case-sensitive.
  • -d β€” Omit the backslash mark used to denote a wrapped line.
  • -M β€” Disable the use of mmap.
  • -r β€” Default to using regexp searches.
  • -s β€” Squeeze-mode. replaces multiple blank lines with a single blank line. so much tidier.
  • -t β€” Display tabs as ^I. if this option is immediately followed by an integer, that integer sets the tab width, e.g., -t4.
  • -u β€” Disable UTF-8 mode even if the locale dictates it.
  • +u β€” Force UTF-8 mode. by default most uses the current locale to determine whether UTF-8 mode should be used. the +u and -u switches let you override that behavior.
  • -v β€” Display control characters as in ^A for control A. normally most doesn't interpret control characters.
  • -w β€” Wrap lines. πŸŽ€
  • -z β€” Disable gunzip-on-the-fly.
  • +/string β€” Start up at the line containing the first occurrence of string.
  • +lineno β€” Start up at the specified line-number.
  • +d β€” this switch should only be used if you want the option to delete a file while viewing it. it makes it easier to clean unwanted files out of a directory. the file is deleted with the interactive key sequence :D and then confirming with y.
  • +s β€” Secure Mode β€” no edit, cd, shell, and reading files not already listed on the command line. locked down, respectfully. πŸ”’

🫢 COMMAND USAGE 🫢

the commands take effect immediately; you do not need to type a carriage return. so don't sit there waiting, bestie. in the following commands, i is a numerical argument (1 by default).

  • SPACE, CTRL-D, NEXT_SCREEN β€” Display another windowful, or jump i windowfuls if i is specified.
  • RETURN, DOWN_ARROW, V, CTRL-N β€” Display another line, or i more lines, if specified.
  • UP_ARROW, ^, CTRL-P β€” Display previous line, or i previous lines, if specified.
  • T, ESCAPE< β€” Move to top of buffer.
  • B, ESCAPE> β€” Move to bottom of buffer.
  • RIGHT_ARROW, TAB, > β€” Scroll window left 60i columns to view lines that are beyond the right margin of the window.
  • LEFT_ARROW, CTRL-B, < β€” Scroll window right 60i columns to view lines that are beyond the left margin of the window.
  • U, CTRL-U, DELETE, PREV_SCREEN β€” Skip back i windowfuls and then print a windowful.
  • R, CTRL-R β€” Redraw the window.
  • J, G β€” if i is not specified, then prompt for a line number then jump to that line; otherwise just jump to line i.
  • % β€” if i is not specified, then prompt for a percent number then jump to that percent of the file; otherwise just jump to i percent of the file.
  • W, w β€” if the current screen width is 80, make it 132 and vice-versa. for other values, this command is ignored.
  • Q, CTRL-X CTRL-C, CTRL-K E β€” Exit from most. on VMS, ^Z also exits.
  • h, CTRL-H, HELP, PF2 β€” Help. gives a description of all the most commands. the most environment variable MOST_HELP must be set for this to be meaningful.
  • f, /, CTRL-F, FIND, GOLD PF3 β€” Prompt for a string and search forward from the current line for the ith distinct line containing the string. CTRL-G aborts.
  • ? β€” Prompt for a string and search backward for the ith distinct line containing the string. CTRL-G aborts.
  • n β€” Search for the next i lines containing an occurrence of the last search string, in the direction of the previous search.
  • m, SELECT, CTRL-@, CTRL-K M, PERIOD β€” Set a mark on the current line for later reference.
  • INSERT_HERE, CTRL-X CTRL-X, COMMA, CTRL-K RETURN, GOLD PERIOD β€” Set a mark on the current line but return to the previous mark. this lets you toggle back and forth between two positions in the file. main character energy, bouncing between plot points. πŸ‘‘
  • l, L β€” Toggle locking for this window. the window is locked if there is a * at the left edge of the status line. windows locked together, scroll together.
  • CTRL-X 2, CTRL-W 2, GOLD X β€” Split this window in half.
  • CTRL-X o, CTRL-W o, o, GOLDUP, GOLDDOWN β€” Move to other window.
  • CTRL-X 0, CTRL-W 0, GOLD V β€” Delete this window.
  • CTRL-X 1, CTRL-W 1, GOLD O β€” Delete all other windows, leaving only one window.
  • E, e β€” Edit this file.
  • $, ESC $ β€” This is system dependent. on VMS, this causes most to spawn a subprocess; when the user exits the process, most is resumed. on UNIX systems, most simply suspends itself.
  • :n β€” Skip to the next filename given in the command line. use the arrow keys to scroll forward or backward through the file list. Q quits most and any other key selects the given file.
  • :c β€” Toggle case sensitive search.
  • :D β€” Delete current file. this command is only meaningful with the +d switch.
  • :o, :O β€” Toggle various options. with this key sequence, most displays a prompt asking the user to hit one of: bdtvw. the b, t, v, and w options have the same meaning as the command line switches. for example, the w option will toggle wrapping on and off for the current window.

the d option must be used with a prefix integer i. all lines indented beyond i columns will not be displayed. for example, consider the fragment:

int main(int argc, char **argv)
{
  int i;
  for (i = 0; i < argc, i++)
    {
      fprintf(stdout,"%i: %s\n",i,argv[i]);
    }
  return 0;
}

the key sequence 1:od will cause most to display the file ignoring all lines indented beyond the first column. so for the example above, most would display:

int main(int argc, char **argv)...
}

where the ... indicates lines that follow are not displayed. so clean. so minimal. we love a filtered feed. 🌸


🧚 HINTS 🧚

CTRL-G aborts the commands that require you to type something in at a prompt. and the back-quote key has a special meaning here β€” it's used to quote certain characters. this is useful when you're searching for the occurrence of a string with a control character, or a string at the beginning of a line. in the latter case, to find the occurrence of The at the beginning of a line, enter `^JThe where ` quotes the CTRL-J. iykyk. πŸ’œ

🫢 ENVIRONMENT 🫢

okay so most reads a lil set of environment variables, and they're all lowkey iconic, so let's go:

  • MOST_SWITCHES β€” this one is your "defaults but make it permanent" bestie. It sets switches you use all the time. Like, some people are obsessed with running most with the -s option so that excess blank lines are not displayed (groundbreaking, honestly). On VMS this is normally done in login.com through the line:
$ define MOST_SWITCHES "-s"
  • MOST_EDITOR, SLANG_EDITOR β€” either of these two tells most which editor to invoke when you wanna edit a file. The value can contain %s and %d formatting descriptors that stand for the file name and the line number, respectively (so fancy ✨). For example, if JED is your editor, then set MOST_EDITOR to 'jed %s -g %d'.
  • MOST_HELP β€” use this one to point at an alternate help file. That's it, that's the whole vibe.
  • MOST_INITFILE β€” set this to specify the initialization file to load during startup. The default action is to load the system configuration file and then a personal configuration file called .mostrc on Unix, and most.rc on other systems. slay, two layers of customization, we love to see it πŸ’…

πŸŽ€ CONFIGURATION FILE SYNTAX πŸŽ€

When most starts up, it tries to read a system configuration file and then a personal configuration file. These files are where you get to specify key-bindings and colors, which is giving main character energy ngl.

To bind a key to a particular function use the syntax:

setkey function-name key-sequence

The setkey command requires two arguments, no more no less, periodt. The function-name argument specifies the function that is to be executed as a response to the keys specified by the key-sequence argument are pressed. For example,

setkey   "up"     "^P"

indicates that when Ctrl-P is pressed then the function up is to be executed. yes bestie, you just made Ctrl-P go up, iconic.

Sometimes, it is necessary to first unbind a key-sequence before rebinding it in order via the unsetkey function:

unsetkey "^F"
🫣 fr fr, sometimes you gotta break up with a binding before you can commit to a new one. it's giving healthy boundaries.

Colors may be defined through the use of the color keyword in the the configuration file using the syntax:

color OBJECT-NAME FOREGROUND-COLOR BACKGROUND-COLOR

Here, OBJECT-NAME can be any one of the following items:

  • status β€” the status line πŸ‘‘
  • underline β€” underlined text
  • overstrike β€” overstruck text
  • normal β€” anything else

See the sample configuration files for more information.


πŸ’€ BUGS πŸ’€

okay, real talk time. Almost all of the known bugs or limitations of most are due to a desire to read and interpret control characters in files. Not me defending it, just explaining the lore.

One problem concerns the use of backspace characters to underscore or overstrike other characters. most makes an attempt to use terminal escape sequences to simulate this behavior. One side effect is the one does not always get what one expects when scrolling right and left through a file. 😭 When in doubt, use the -v and -b options of most.

The regular-expression searches may fail to find strings that involve backspace/underscore used for highlighting. The regular-expression syntax is described in the S-Lang Library documentation.


✨ AUTHOR ✨

John E. Davis <jed@jedsoft.org>


🌈 ACKNOWLEDGEMENTS 🌈

Over the years, many people have contributed to most in one way or another, e.g., via code patches, bug-fixes, comments, or criticisms. I am particularly grateful to the very early adopters of the program who took a chance with a fledgling software project headed by someone learning the underlying language. These include:

Mats Akerberg, Henk D. Davids, Rex O. Livingston, and Mark Pizzolato contributed to the early VMS versions of most. In particular, Mark worked on it to get it ready for DECUS.

Foteos Macrides adapted most for use in cswing and gopher. A few features of the present version of most was inspired from his work.

I am grateful to Robert Mills for re-writing the search routines to use regular expressions.

Sven Oliver Moll came up with the idea of automatic detection of zipped files.

I would also like to thank Shinichi Hama for his valuable criticisms of most.

Javier Kohen was instrumental in the support for UTF-8.

Thanks to David W. Sanderson for adapting the early documentation to nroff man page source format.


and that's the whole page, bestie πŸ’– this manual page is MOST(1), dated 30 July 2022, and it ATE. go forth and scroll with your whole chest πŸ¦‹πŸ’…πŸŽ€