1MOST(1) MOST(1)
2
3
4
6 most - browse or page through a text file
7
9 most [ -1 ] [ -b ] [ -C ] [ -c ] [ -d ] [ -M ] [ -r ] [ -s ] [ -t ] [
10 -u ] [ -v ] [ -w ] [ -z ] [ +/string ] [ +line-number ] [ +d ] [ +s ] [
11 +u ] [ file... ]
12
13
15 most is a paging program that displays, one windowful at a time, the
16 contents of a file on a terminal. It pauses after each windowful and
17 prints on the window status line the screen the file name, current line
18 number, and the percentage of the file so far displayed.
19
20 Unlike other paging programs, most is capable of displaying an arbi‐
21 trary number of windows as long as each window occupies at least two
22 screen lines. Each window may contain the same file or a different
23 file. In addition, each window has its own mode. For example, one
24 window may display a file with its lines wrapped while another may be
25 truncating the lines. Windows may be `locked' together in the sense
26 that if one of the locked windows scrolls, all locked windows will
27 scroll. most is also capable of ignoring lines that are indented
28 beyond a user specified value. This is useful when viewing computer
29 programs to pick out gross features of the code. See the `:o' command
30 for a description of this feature.
31
32 In addition to displaying ordinary text files, most can also display
33 binary files as well as files with arbitrary ascii characters. When a
34 file is read into a buffer, most examines the first 32 bytes of the
35 file to determine if the file is a binary file and then switches to the
36 appropriate mode. However, this feature may be disabled with the -k
37 option. See the description of the -b, -k, -v, and -t options for fur‐
38 ther details.
39
40 Text files may contain combinations of underscore and backspace charac‐
41 ters causing a printer to underline or overstrike. When most recog‐
42 nizes this, it inserts the appropriate escape sequences to achieve the
43 desired effect. In addition, some files cause the printer to over‐
44 strike some characters by embedding carriage return characters in the
45 middle of a line. When this occurs, most displays the overstruck char‐
46 acter with a bold attribute. This feature facilitates the reading of
47 UNIX man pages or a document produced by runoff. In particular, view‐
48 ing this document with most should illustrate this behavior provided
49 that the underline characters have not been stripped. This may be
50 turned off with the -v option.
51
52 By default, lines with more characters than the terminal width are not
53 wrapped but are instead truncated. When truncation occurs, this is
54 indicated by a `$' in the far right column of the terminal screen. The
55 RIGHT and LEFT arrow keys may be used to view lines which extend past
56 the margins of the screen. The -w option may be used to override this
57 feature. When a window is wrapped, the character `\' will appear at
58 the right edge of the window.
59
60 Commands are listed below.
61
63 -1 VT100 mode. This is meaningful only on VMS systems. This
64 option should be used if the terminal is strictly a VT100. This
65 implies that the terminal does not have the ability to delete
66 and insert multiple lines. VT102s and above have this ability.
67
68 -b Binary mode. Use this switch when you want to view files con‐
69 taining 8 bit characters. most will display the file 16 bytes
70 per line in hexadecimal notation. A typical line looks like:
71
72 01000000 40001575 9C23A020 4000168D ....@..u.#. @...
73
74 When used with the -v option, the same line looks like:
75
76 ^A^@^@^@ @^@^U u 9C #A0 @^@^V8D ....@..u.#. @...
77
78 -C Disable color support.
79
80 -c Make searches case-sensitive
81
82 -d Omit the backslash mark used to denote a wrapped line.
83
84 -M Disable the use of mmap.
85
86 -r Default to using regexp searches
87
88 -s Squeeze-mode. Replace multiple blank lines with a single blank
89 line.
90
91 -t Display tabs as ^I. If this option is immediately followed by
92 an integer, the integer sets the tab width, e.g., -t4
93
94 -u Disable UTF-8 mode even if the locale dictates it
95
96 +u Force UTF-8 mode. By default most will use the current locale
97 to determine if UTF-8 mode should be used. The +u and -u
98 switches allow the behavior to be overridden
99
100 -v Display control characters as in `^A' for control A. Normally
101 most does not interpret control characters.
102
103 -w Wrap lines
104
105 -z Disable gunzip-on-the-fly
106
107 +/string
108 Start up at the line containing the first occurrence of string
109
110 +lineno
111 Start up at the specified line-number
112
113 +d This switch should only be used if you want the option to delete
114 a file while viewing it. This makes it easier to clean unwanted
115 files out of a directory. The file is deleted with the interac‐
116 tive key sequence `:D' and then confirming with `y'.
117
118 +s Secure Mode-- no edit, cd, shell, and reading files not already
119 listed on the command line.
120
122 The commands take effect immediately; it is not necessary to type a
123 carriage return. In the following commands, i is a numerical argument
124 (1 by default).
125
126 SPACE, CTRL-D, NEXT_SCREEN
127 Display another windowful, or jump i windowfuls if i is speci‐
128 fied.
129
130 RETURN, DOWN_ARROW, V, CTRL-N
131 Display another line, or i more lines, if specified.
132
133 UP_ARROW, ^, CTRL-P
134 Display previous line, or i previous lines, if specified.
135
136 T, ESCAPE<
137 Move to top of buffer.
138
139 B, ESCAPE>
140 Move to bottom of buffer.
141
142 RIGHT_ARROW, TAB, >
143 Scroll window left 60i columns to view lines that are beyond the
144 right margin of the window.
145
146 LEFT_ARROW, CTRL-B, <
147 Scroll window right 60i columns to view lines that are beyond
148 the left margin of the window.
149
150 U, CTRL-U, DELETE, PREV_SCREEN
151 Skip back i windowfuls and then print a windowful.
152
153 R, CTRL-R
154 Redraw the window.
155
156 J, G If i is not specified, then prompt for a line number then
157 jump to that line otherwise just jump to line i.
158
159 % If i is not specified, then prompt for a percent number then
160 jump to that percent of the file otherwise just jump to i per‐
161 cent of the file.
162
163 W, w If the current screen width is 80, make it 132 and vice-
164 versa. For other values, this command is ignored.
165
166 Q, CTRL-X CTRL-C, CTRL-K E
167 Exit from most. On VMS, ^Z also exits.
168
169 h, CTRL-H, HELP, PF2
170 Help. Give a description of all the most commands. The most
171 environment variable MOST_HELP must be set for this to be mean‐
172 ingful.
173
174 f, /, CTRL-F, FIND, GOLD PF3
175 Prompt for a string and search forward from the current line
176 for ith distinct line containing the string. CTRL-G aborts.
177
178 ? Prompt for a string and search backward for the ith distinct
179 line containing the string. CTRL-G aborts.
180
181 n Search for the next i lines containing an occurrence of the last
182 search string in the direction of the previous search.
183
184 m, SELECT, CTRL-@, CTRL-K M, PERIOD
185 Set a mark on the current line for later reference.
186
187 INSERT_HERE, CTRL-X CTRL-X, COMMA, CTRL-K RETURN, GOLD PERIOD
188 Set a mark on the current line but return to previous mark.
189 This allows the user to toggle back and forth between two posi‐
190 tions in the file.
191
192 l, L Toggle locking for this window. The window is locked if there
193 is a `*' at the left edge of the status line. Windows locked
194 together, scroll together.
195
196 CTRL-X 2, CTRL-W 2, GOLD X
197 Split this window in half.
198
199 CTRL-X o, CTRL-W o, o, GOLDUP, GOLDDOWN
200 Move to other window.
201
202 CTRL-X 0, CTRL-W 0, GOLD V
203 Delete this window.
204
205 CTRL-X 1, CTRL-W 1, GOLD O
206 Delete all other windows, leaving only one window.
207
208 E, e Edit this file.
209
210 $, ESC $
211 This is system dependent. On VMS, this causes most to spawn a
212 subprocess. When the user exits the process, most is resumed.
213 On UNIX systems, most simply suspends itself.
214
215 :n Skip to the next filename given in the command line. Use the
216 arrow keys to scroll forward or backward through the file list.
217 `Q' quits most and any other key selects the given file.
218
219 :c Toggle case sensitive search.
220
221 :D Delete current file. This command is only meaningful with the
222 +d switch.
223
224 :o, :O Toggle various options. With this key sequence, most displays a
225 prompt asking the user to hit one of: bdtvw. The `b', `t', `v',
226 and `w' options have the same meaning as the command line
227 switches. For example, the `w' option will toggle wrapping on
228 and off for the current window.
229
230 The `d' option must be used with a prefix integer i. All lines
231 indented beyond i columns will not be displayed. For example,
232 consider the fragment:
233
234
235
236 int main(int argc, char **argv)
237 {
238 int i;
239 for (i = 0; i < argc, i++)
240 {
241 fprintf(stdout,"%i: %s\n",i,argv[i]);
242 }
243 return 0;
244 }
245 The key sequence `1:od' will cause most to display the file
246 ignoring all lines indented beyond the first column. So for the
247 example above, most would display:
248
249 int main(int argc, char **argv)...
250 }
251 where the `...' indicates lines that follow are not displayed.
252
254 CTRL-G aborts the commands requiring the user to type something in at a
255 prompt. The back-quote key has a special meaning here. It is used to
256 quote certain characters. This is useful when search for the occur‐
257 rence of a string with a control character or a string at the beginning
258 of a line. In the latter case, to find the occurrence of `The' at the
259 beginning of a line, enter `^JThe where ` quotes the CTRL-J.
260
262 most uses the following environment variables:
263
264 MOST_SWITCHES
265 This variable sets commonly used switches. For example, some
266 people prefer to use most with the -s option so that excess
267 blank lines are not displayed. On VMS this is normally done
268 done in the login.com through the line:
269
270
271
272 $ define MOST_SWITCHES "-s"
273
274 MOST_EDITOR, SLANG_EDITOR
275 Either of these environment variables specify an editor for
276 most to invoke to edit a file. The value can contain %s and %d
277 formatting descriptors that represent the file name and line
278 number, respectively. For example, if JED is your editor, then
279 set MOST_EDITOR to 'jed %s -g %d'.
280
281 MOST_HELP
282 This variable may be used to specify an alternate help file.
283
284 MOST_INITFILE
285 Set this variable to specify the initialization file to load
286 during startup. The default action is to load the system con‐
287 figuration file and then a personal configuration file called
288 .mostrc on Unix, and most.rc on other systems.
289
291 When most starts up, it tries to read a system configuration file and
292 then a personal configuration file. These files may be used to specify
293 key-bindings and colors.
294
295 To bind a key to a particular function use the syntax:
296
297 setkey function-name key-sequence
298
299 The setkey command requires two arguments. The function-name argument
300 specifies the function that is to be executed as a response to the keys
301 specified by the key-sequence argument are pressed. For example,
302
303 setkey "up" "^P"
304
305 indicates that when Ctrl-P is pressed then the function up is to be
306 executed.
307
308 Sometimes, it is necessary to first unbind a key-sequence before
309 rebinding it in order via the unsetkey function:
310
311 unsetkey "^F"
312
313 Colors may be defined through the use of the color keyword in the the
314 configuration file using the syntax:
315
316 color OBJECT-NAME FOREGROUND-COLOR BACKGROUND-COLOR
317
318 Here, OBJECT-NAME can be any one of the following items:
319
320 status -- the status line
321 underline -- underlined text
322 overstrike -- overstruck text
323 normal -- anything else
324
325 See the sample configuration files for more information.
326
328 Almost all of the known bugs or limitations of most are due to a desire
329 to read and interpret control characters in files. One problem con‐
330 cerns the use of backspace characters to underscore or overstrike other
331 characters. most makes an attempt to use terminal escape sequences to
332 simulate this behavior. One side effect is the one does not always get
333 what one expects when scrolling right and left through a file. When in
334 doubt, use the -v and -b options of most.
335
336 The regular-expression searches may fail to find strings that involve
337 backspace/underscore used for highlighting. The regular-expression
338 syntax is described in the S-Lang Library documentation.
339
341 John E. Davis <jed@jedsoft.org>
342
344 Over the years, many people have contributed to most in one way or
345 another, e.g., via code patches, bug-fixes, comments, or criticisms. I
346 am particularly grateful to the very early adopters of the program who
347 took a chance with a fledgling software project headed by someone
348 learning the underlying language. These include:
349
350 Mats Akerberg, Henk D. Davids, Rex O. Livingston, and Mark Pizzolato
351 contributed to the early VMS versions of most. In particular, Mark
352 worked on it to get it ready for DECUS.
353
354 Foteos Macrides adapted most for use in cswing and gopher. A few fea‐
355 tures of the present version of most was inspired from his work.
356
357 I am grateful to Robert Mills for re-writing the search routines to use
358 regular expressions.
359
360 Sven Oliver Moll came up with the idea of automatic detection of zipped
361 files.
362
363 I would also like to thank Shinichi Hama for his valuable criticisms of
364 most.
365
366 Javier Kohen was instrumental in the support for UTF-8.
367
368 Thanks to David W. Sanderson for adapting the early documentation to
369 nroff man page source format.
370
371
372
373 17 February 2019 MOST(1)