.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "MOST" "1" "17 February 2019" "" "" .SH NAME most \- browse or page through a text file .SH SYNOPSIS \fBmost\fR [ \fB-1\fR ] [ \fB-b\fR ] [ \fB-C\fR ] [ \fB-c\fR ] [ \fB-d\fR ] [ \fB-M\fR ] [ \fB-r\fR ] [ \fB-s\fR ] [ \fB-t\fR ] [ \fB-u\fR ] [ \fB-v\fR ] [ \fB-w\fR ] [ \fB-z\fR ] [ \fB+/\fIstring\fB\fR ] [ \fB+\fIline-number\fB\fR ] [ \fB+d\fR ] [ \fB+s\fR ] [ \fB+u\fR ] [ \fB\fIfile...\fB\fR ] .SH "DESCRIPTION" .PP \fBmost\fR 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. .PP Unlike other paging programs, \fBmost\fR is capable of displaying an arbitrary number of windows as long as each window occupies at least two screen lines. Each window may contain the same file or a different file. In addition, each window has its own mode. For example, one window may display a file with its lines wrapped while another may be truncating the lines. Windows may be `locked' together in the sense that if one of the locked windows scrolls, all locked windows will scroll. \fBmost\fR is also capable of ignoring lines that are indented beyond a user specified value. This is useful when viewing computer programs to pick out gross features of the code. See the `:o' command for a description of this feature. .PP In addition to displaying ordinary text files, \fBmost\fR can also display binary files as well as files with arbitrary ascii characters. When a file is read into a buffer, \fBmost\fR examines the first 32 bytes of the file to determine if the file is a binary file and then switches to the appropriate mode. However, this feature may be disabled with the -k option. See the description of the -b, -k, -v, and -t options for further details. .PP Text files may contain combinations of underscore and backspace characters causing a printer to underline or overstrike. When \fBmost\fR recognizes this, it inserts the appropriate escape sequences to achieve the desired effect. In addition, some files cause the printer to overstrike some characters by embedding carriage return characters in the middle of a line. When this occurs, \fBmost\fR displays the overstruck character with a bold attribute. This feature facilitates the reading of UNIX man pages or a document produced by runoff. In particular, viewing this document with \fBmost\fR should illustrate this behavior provided that the underline characters have not been stripped. This may be turned off with the -v option. .PP By default, lines with more characters than the terminal width are not wrapped but are instead truncated. When truncation occurs, this is indicated by a `$' in the far right column of the terminal screen. The RIGHT and LEFT arrow keys may be used to view lines which extend past the margins of the screen. The -w option may be used to override this feature. When a window is wrapped, the character `\\' will appear at the right edge of the window. .PP Commands are listed below. .SH "OPTIONS" .TP \fB-1\fR VT100 mode. This is meaningful only on VMS systems. This option should be used if the terminal is strictly a VT100. This implies that the terminal does not have the ability to delete and insert multiple lines. VT102s and above have this ability. .TP \fB-b\fR Binary mode. Use this switch when you want to view files containing 8 bit characters. \fBmost\fR will display the file 16 bytes per line in hexadecimal notation. A typical line looks like: .nf 01000000 40001575 9C23A020 4000168D ....@..u.#. @... .fi When used with the -v option, the same line looks like: .nf ^A^@^@^@ @^@^U u 9C #A0 @^@^V8D ....@..u.#. @... .fi .TP \fB-C\fR Disable color support. .TP \fB-c\fR Make searches case-sensitive .TP \fB-d\fR Omit the backslash mark used to denote a wrapped line. .TP \fB-M\fR Disable the use of mmap. .TP \fB-r\fR Default to using regexp searches .TP \fB-s\fR Squeeze-mode. Replace multiple blank lines with a single blank line. .TP \fB-t\fR Display tabs as ^I. If this option is immediately followed by an integer, the integer sets the tab width, e.g., -t4 .TP \fB-u\fR Disable UTF-8 mode even if the locale dictates it .TP \fB+u\fR Force UTF-8 mode. By default \fBmost\fR will use the current locale to determine if UTF-8 mode should be used. The +u and -u switches allow the behavior to be overridden .TP \fB-v\fR Display control characters as in `^A' for control A. Normally \fBmost\fR does not interpret control characters. .TP \fB-w\fR Wrap lines .TP \fB-z\fR Disable gunzip-on-the-fly .TP \fB+/\fIstring\fB\fR Start up at the line containing the first occurrence of string .TP \fB+\fIlineno\fB\fR Start up at the specified line-number .TP \fB+d\fR This switch should only be used if you want the option to delete a file while viewing it. This 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'. .TP \fB+s\fR Secure Mode-- no edit, cd, shell, and reading files not already listed on the command line. .SH "COMMAND USAGE" .PP The commands take effect immediately; it is not necessary to type a carriage return. In the following commands, \fBi\fR is a numerical argument (1 by default). .TP \fBSPACE, CTRL-D, NEXT_SCREEN\fR Display another windowful, or jump \fBi\fR windowfuls if \fBi\fR is specified. .TP \fBRETURN, DOWN_ARROW, V, CTRL-N\fR Display another line, or \fBi\fR more lines, if specified. .TP \fBUP_ARROW, ^, CTRL-P\fR Display previous line, or \fBi\fR previous lines, if specified. .TP \fBT, ESCAPE<\fR Move to top of buffer. .TP \fBB, ESCAPE>\fR Move to bottom of buffer. .TP \fBRIGHT_ARROW, TAB, >\fR Scroll window left 60\fBi\fR columns to view lines that are beyond the right margin of the window. .TP \fBLEFT_ARROW, CTRL-B, <\fR Scroll window right 60\fBi\fR columns to view lines that are beyond the left margin of the window. .TP \fBU, CTRL-U, DELETE, PREV_SCREEN\fR Skip back \fBi\fR windowfuls and then print a windowful. .TP \fBR, CTRL-R\fR Redraw the window. .TP \fBJ, G\fR If \fBi\fR is not specified, then prompt for a line number then jump to that line otherwise just jump to line i. .TP \fB%\fR If \fBi\fR is not specified, then prompt for a percent number then jump to that percent of the file otherwise just jump to \fBi\fR percent of the file. .TP \fBW, w\fR If the current screen width is 80, make it 132 and vice-versa. For other values, this command is ignored. .TP \fBQ, CTRL-X CTRL-C, CTRL-K E\fR Exit from \fBmost\fR\&. On VMS, ^Z also exits. .TP \fBh, CTRL-H, HELP, PF2\fR Help. Give a description of all the \fBmost\fR commands. The \fBmost\fR environment variable MOST_HELP must be set for this to be meaningful. .TP \fBf, /, CTRL-F, FIND, GOLD PF3\fR Prompt for a string and search forward from the current line for ith distinct line containing the string. CTRL-G aborts. .TP \fB?\fR Prompt for a string and search backward for the ith distinct line containing the string. CTRL-G aborts. .TP \fBn\fR Search for the next \fBi\fR lines containing an occurrence of the last search string in the direction of the previous search. .TP \fBm, SELECT, CTRL-@, CTRL-K M, PERIOD\fR Set a mark on the current line for later reference. .TP \fBINSERT_HERE, CTRL-X CTRL-X, COMMA, CTRL-K RETURN, GOLD PERIOD\fR Set a mark on the current line but return to previous mark. This allows the user to toggle back and forth between two positions in the file. .TP \fBl, L\fR 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. .TP \fBCTRL-X 2, CTRL-W 2, GOLD X\fR Split this window in half. .TP \fBCTRL-X o, CTRL-W o, o, GOLDUP, GOLDDOWN\fR Move to other window. .TP \fBCTRL-X 0, CTRL-W 0, GOLD V\fR Delete this window. .TP \fBCTRL-X 1, CTRL-W 1, GOLD O\fR Delete all other windows, leaving only one window. .TP \fBE, e\fR Edit this file. .TP \fB$, ESC $\fR This is system dependent. On VMS, this causes \fBmost\fR to spawn a subprocess. When the user exits the process, \fBmost\fR is resumed. On UNIX systems, \fBmost\fR simply suspends itself. .TP \fB:n\fR 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 \fBmost\fR and any other key selects the given file. .TP \fB:c\fR Toggle case sensitive search. .TP \fB:D\fR Delete current file. This command is only meaningful with the +d switch. .TP \fB:o, :O\fR Toggle various options. With this key sequence, \fBmost\fR 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 \fBi\fR columns will not be displayed. For example, consider the fragment: .TP \fB\fR .nf int main(int argc, char **argv) { int i; for (i = 0; i < argc, i++) { fprintf(stdout,"%i: %s\\n",i,argv[i]); } return 0; } .fi The key sequence `1:od' will cause \fBmost\fR to display the file ignoring all lines indented beyond the first column. So for the example above, \fBmost\fR would display: .nf int main(int argc, char **argv)... } .fi where the `...' indicates lines that follow are not displayed. .SH "HINTS" .PP CTRL-G aborts the commands requiring the user to type something in at a prompt. The back-quote key has a special meaning here. It is used to quote certain characters. This is useful when search 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. .SH "ENVIRONMENT" .PP \fBmost\fR uses the following environment variables: .TP \fBMOST_SWITCHES\fR This variable sets commonly used switches. For example, some people prefer to use \fBmost\fR with the -s option so that excess blank lines are not displayed. On VMS this is normally done done in the login.com through the line: .TP \fB\fR .nf $ define MOST_SWITCHES "-s" .fi .TP \fBMOST_EDITOR, SLANG_EDITOR\fR Either of these environment variables specify an editor for \fBmost\fR to invoke to edit a file. The value can contain %s and %d formatting descriptors that represent the file name and line number, respectively. For example, if JED is your editor, then set MOST_EDITOR to 'jed %s -g %d'. .TP \fBMOST_HELP\fR This variable may be used to specify an alternate help file. .TP \fBMOST_INITFILE\fR Set this variable 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. .SH "CONFIGURATION FILE SYNTAX" .PP When \fBmost\fR starts up, it tries to read a system configuration file and then a personal configuration file. These files may be used to specify key-bindings and colors. .PP To bind a key to a particular function use the syntax: .nf setkey function-name key-sequence .fi .PP The setkey command requires two arguments. 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, .nf setkey "up" "^P" .fi .PP indicates that when Ctrl-P is pressed then the function up is to be executed. .PP Sometimes, it is necessary to first unbind a key-sequence before rebinding it in order via the unsetkey function: .nf unsetkey "^F" .fi .PP Colors may be defined through the use of the color keyword in the the configuration file using the syntax: .nf color OBJECT-NAME FOREGROUND-COLOR BACKGROUND-COLOR .fi .PP Here, OBJECT-NAME can be any one of the following items: .nf status -- the status line underline -- underlined text overstrike -- overstruck text normal -- anything else .fi .PP See the sample configuration files for more information. .SH "BUGS" .PP Almost all of the known bugs or limitations of \fBmost\fR are due to a desire to read and interpret control characters in files. One problem concerns the use of backspace characters to underscore or overstrike other characters. \fBmost\fR 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 \fBmost\fR\&. .PP 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. .SH "AUTHOR" .PP John E. Davis .SH "ACKNOWLEDGEMENTS" .PP Over the years, many people have contributed to \fBmost\fR 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: .PP Mats Akerberg, Henk D. Davids, Rex O. Livingston, and Mark Pizzolato contributed to the early VMS versions of \fBmost\fR\&. In particular, Mark worked on it to get it ready for DECUS. .PP Foteos Macrides adapted \fBmost\fR for use in cswing and gopher. A few features of the present version of \fBmost\fR was inspired from his work. .PP I am grateful to Robert Mills for re-writing the search routines to use regular expressions. .PP Sven Oliver Moll came up with the idea of automatic detection of zipped files. .PP I would also like to thank Shinichi Hama for his valuable criticisms of \fBmost\fR\&. .PP Javier Kohen was instrumental in the support for UTF-8. .PP Thanks to David W. Sanderson for adapting the early documentation to nroff man page source format.