MOST(1) | General Commands Manual | MOST(1) |
most - browse or page through a text file
most [-1bCcdMstuvwz] [+lineno] [+c] [+d] [+s] [+u] [+/string] [filename...]
most 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.
Unlike other paging programs, most 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. most 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.
In addition to displaying ordinary text files, most can also display binary files as well as files with arbitrary ascii characters. When a file is read into a buffer, most 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.
Text files may contain combinations of underscore and backspace characters causing a printer to underline or overstrike. When most 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, most 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 most should illustrate this behavior provided that the underline characters have not been stripped. This may be turned off with the -v option.
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.
Commands are listed below.
01000000 40001575 9C23A020 4000168D ....@..u.#. @...
^A^@^@^@ @^@^U u 9C #A0 @^@^V8D ....@..u.#. @...
Some commands have an optional numeric argument id ,entered before the command. If not given, the default value of i is 1.
Commands take effect immediately; typing a RETURN after isn't necessary or correct. (Besides, RETURN itself is a command.)
Example: to go down one line, press the DOWN_ARROW key. To go down 20 lines, press 2 then 0 then the DOWN_ARROW key.
m, SELECT, CTRL-@, CTRL-K M, PERIOD
int main(int argc, char **argv) { int i; for (i = 0; i < argc, i++) { fprintf(stdout,"%i: %s\n",i,argv[i]); } return 0; }
int main(int argc, char **argv)... }
CTRL-G aborts the commands requiring the user to type something in at a prompt. The backquote 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.
most uses the following environment variables:
$ define MOST_SWITCHES "-s"
When most starts up, it tries to read a system configuration file and then a personal configuration file. These files may be used to specify keybindings and colors.
To bind a key to a particular function use the syntax:
setkey function-name key-sequence
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,
setkey "up" "^P"
indicates that when Ctrl-P is pressed then the function up is to be executed.
Sometimes, it is necessary to first unbind a key-sequence before rebinding it in order via the unsetkey function:
unsetkey "^F"
Colors may be defined through the use of the color keyword in 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 -- overstriked text
normal -- anything else
See the sample configuration files for more information.
Almost all of the known bugs or limitations of most 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. 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.
John E. Davis
davis@space.mit.edu
I would like to thank the users of most for valuable comments and criticisms. I would especially like to thank those individuals who have contributed code to most.
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 <MACRIDES@SCI.WFEB.EDU> 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 <robert@jna.com.au> for re-writing the search routines to use regular expressions.
Sven Oliver Moll <smol0075@rz.uni-hildesheim.de> 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 (dws@cs.wisc.edu) for adapting the documentation to nroff man page source format.
May 1999 |