Annotation of src/usr.bin/more/more.1, Revision 1.8
1.8 ! aaron 1: .\" $OpenBSD: more.1,v 1.7 1996/10/14 15:23:53 etheisen Exp $
1.3 etheisen 2: .\" Copyright (c) 1980 The Regents of the University of California.
1.1 deraadt 3: .\" All rights reserved.
4: .\"
5: .\" Redistribution and use in source and binary forms, with or without
6: .\" modification, are permitted provided that the following conditions
7: .\" are met:
8: .\" 1. Redistributions of source code must retain the above copyright
9: .\" notice, this list of conditions and the following disclaimer.
10: .\" 2. Redistributions in binary form must reproduce the above copyright
11: .\" notice, this list of conditions and the following disclaimer in the
12: .\" documentation and/or other materials provided with the distribution.
13: .\" 3. All advertising materials mentioning features or use of this software
14: .\" must display the following acknowledgement:
15: .\" This product includes software developed by the University of
16: .\" California, Berkeley and its contributors.
17: .\" 4. Neither the name of the University nor the names of its contributors
18: .\" may be used to endorse or promote products derived from this software
19: .\" without specific prior written permission.
20: .\"
21: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24: .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31: .\" SUCH DAMAGE.
32: .\"
1.3 etheisen 33: .\" @(#)more.1 6.6 (Berkeley) 4/18/91
1.1 deraadt 34: .\"
1.5 etheisen 35: .TH MORE 1 "October 14, 1996"
1.3 etheisen 36: .UC 4
37: .SH NAME
38: more, page \- file perusal filter for crt viewing
39: .SH SYNOPSIS
40: .B more
41: [
42: .B \-cdflsu
43: ]
44: [
45: .B \-\fIn\fP
46: ]
47: [
1.8 ! aaron 48: .B +\fIlinenumber\fP
1.3 etheisen 49: ]
50: [
51: .B +/\fIpattern\fP
52: ] [ name ... ]
53: .LP
54: .B page
55: .I "more options"
56: .SH DESCRIPTION
57: .I More
58: is a filter which allows examination of a continuous text
59: one screenful at a time on a soft-copy terminal.
1.6 etheisen 60: It normally pauses after each screenful, printing the current file name
61: at the bottom of the screen or --More-- if input is from a pipe.
1.3 etheisen 62: If the user then types a carriage return, one more line is displayed.
63: If the user hits a space,
64: another screenful is displayed. Other possibilities are enumerated later.
65: .PP
66: The command line options are:
67: .TP
68: .I \-n
69: An integer which is the size (in lines) of the window which
70: .I more
71: will use instead of the default.
72: .TP
73: .B \-c
74: .I More
1.8 ! aaron 75: will draw each page by beginning at the top of the screen and erasing
1.3 etheisen 76: each line just before it draws on it.
1.8 ! aaron 77: This avoids scrolling the screen, making it easier to read while
! 78: .I more
1.3 etheisen 79: is writing.
80: This option will be ignored if the terminal does not have the ability
81: to clear to the end of a line.
82: .TP
83: .B \-d
84: .I More
85: will prompt the user with the message "Press
86: space to continue, \'q\' to quit." at the end of each screenful,
87: and will respond to subsequent illegal user input by
88: printing "Press \'h\' for instructions." instead of ringing the bell.
89: This is useful if
90: .I more
91: is being used as a filter in some setting,
92: such as a class,
93: where many users may be unsophisticated.
94: .TP
95: .B \-f
96: This causes
97: .I more
98: to count logical, rather than screen lines.
99: That is, long lines are not folded.
100: This option is recommended if
101: .I nroff
102: output is being piped through
103: .I ul,
104: since the latter may generate escape sequences.
105: These escape sequences contain characters which would ordinarily occupy
106: screen positions, but which do not print when they are sent to the
107: terminal as part of an escape sequence.
108: Thus
109: .I more
110: may think that lines are longer than they actually are, and fold
111: lines erroneously.
112: .TP
113: .B \-l
114: Do
115: not treat ^\&L (form feed) specially.
116: If this option is not given,
117: .I more
118: will pause after any line that contains a ^\&L, as if the end of a
119: screenful had been reached.
120: Also, if a file begins with a form feed, the screen will be cleared
121: before the file is printed.
122: .TP
123: .B \-s
124: Squeeze multiple blank lines from the output, producing only one blank
125: line. Especially helpful when viewing
126: .I nroff
127: output, this option maximizes the useful information present on the screen.
128: .TP
129: .B \-u
1.1 deraadt 130: Normally,
1.3 etheisen 131: .I more
132: will handle underlining such as produced by
133: .I nroff
134: in a manner appropriate to the particular terminal: if the terminal can
135: perform underlining or has a stand-out mode,
136: .I more
137: will output appropriate escape sequences to enable underlining or stand-out
138: mode for underlined information in the source file. The
139: .I \-u
140: option suppresses this processing.
141: .TP
142: .B +\fIlinenumber\fP
143: Start up at \fIlinenumber\fP.
144: .TP
145: .B +/\fIpattern\fP
146: Start up two lines before the line containing the
147: regular expression \fIpattern\fP.
148: .PP
149: If the program is invoked as
150: .I page,
151: then the screen is cleared before each screenful is printed (but only
152: if a full screenful is being printed), and
153: .I k
154: \- 1 rather
155: than
156: .I k
157: \- 2 lines are printed in each screenful, where
158: .I k
159: is the number of lines the terminal can display.
160: .PP
161: .I More
162: looks in the file
1.4 etheisen 163: .I /usr/share/misc/termcap
1.3 etheisen 164: to determine terminal characteristics,
165: and to determine the default window size.
166: On a terminal capable of displaying 24 lines,
167: the default window size is 22 lines.
168: .PP
169: .I More
170: looks in the environment variable
171: .I MORE
172: to pre-set any flags desired. For example, if you prefer to view files using
173: the
174: .I \-c
175: mode of operation, the
176: .I csh
177: command
178: .I "setenv MORE -c"
179: or the
180: .I sh
181: command sequence
182: .I "MORE='-c' ; export MORE"
183: would cause all invocations of
184: .I more ,
185: including invocations by programs such as
186: .I man
187: and
188: .I msgs ,
189: to use this mode.
190: Normally, the user will place the command sequence which sets up the
191: .I MORE
192: environment variable in the
193: .I .cshrc
194: or
195: .I .profile
196: file.
197: .PP
1.5 etheisen 198: .I More
199: looks in the environment variable
200: .I EDITOR
201: to determine which editor the
202: .I v
203: command invokes.
204: If the editor specified is
205: .I vi
206: or
207: .I ex
208: it will start at the current
209: .I more
210: line number.
211: If no
212: .I EDITOR
213: environment variable is specified the default
214: .I vi
215: editor will be used.
216: .PP
1.3 etheisen 217: If
218: .I more
219: is reading from a file, rather than a pipe, then a percentage is displayed
1.6 etheisen 220: along with the current
221: .I filename
222: prompt.
1.3 etheisen 223: This gives the fraction of the file (in characters, not lines) that has been
224: read so far.
225: .PP
226: Other sequences which may be typed when
227: .I more
228: pauses, and their effects, are as follows (\fIi\fP is an optional integer
229: argument, defaulting to 1) :
230: .PP
231: .IP \fIi\|\fP<space>
232: display
233: .I i
234: more lines, (or another screenful if no argument is given)
235: .PP
236: .IP ^D
237: display 11 more lines (a ``scroll'').
238: If
239: .I i
240: is given, then the scroll size is set to \fIi\|\fP.
241: .PP
242: .IP d
243: same as ^D (control-D)
244: .PP
245: .IP \fIi\|\fPz
246: same as typing a space except that \fIi\|\fP, if present, becomes the new
247: window size.
248: .PP
249: .IP \fIi\|\fPs
250: skip \fIi\|\fP lines and print a screenful of lines
251: .PP
1.7 etheisen 252: .IP \fIi\|\fPf\ or\ \fIi\|\fP^F
1.3 etheisen 253: skip \fIi\fP screenfuls and print a screenful of lines
254: .PP
255: .IP \fIi\|\fPb
256: skip back \fIi\fP screenfuls and print a screenful of lines
257: .PP
258: .IP \fIi\|\fP^B
259: same as b
260: .PP
261: .IP "q or Q"
262: Exit from
263: .I more.
1.8 ! aaron 264: .PP
1.3 etheisen 265: .IP =
266: Display the current line number.
267: .PP
268: .IP v
1.5 etheisen 269: Starts the editor at the current line number if editor is
1.3 etheisen 270: .I vi
1.5 etheisen 271: or
272: .I ex.
273: The environment variable
274: .I EDITOR
275: affects this command according to the rules outlined above.
1.3 etheisen 276: .PP
277: .IP h
278: Help command; give a description of all the
279: .I more
280: commands.
281: .PP
282: .IP \fIi\|\fP/expr
283: search for the \fIi\|\fP-th occurrence of the regular expression \fIexpr.\fP
284: If there are less than \fIi\fP occurrences of \fIexpr\|\fP,
285: and the input is a file (rather than a pipe),
286: then the position in the file remains unchanged.
287: Otherwise, a screenful is displayed, starting two lines before the place
288: where the expression was found.
289: The user's erase and kill characters may be used to edit the regular
290: expression.
291: Erasing back past the first column cancels the search command.
292: .PP
293: .IP \fIi\|\fPn
294: search for the \fIi\|\fP-th occurrence of the last regular expression entered.
295: .PP
296: .IP \'
297: (single quote) Go to the point from which the last search started.
298: If no search has been performed in the current file, this command
299: goes back to the beginning of the file.
300: .PP
301: .IP !command
1.8 ! aaron 302: invoke a shell with \fIcommand\|\fP.
1.3 etheisen 303: The characters `%' and `!' in "command" are replaced with the
304: current file name and the previous shell command respectively.
305: If there is no current file name, `%' is not expanded.
306: The sequences "\\%" and "\\!" are replaced by "%" and "!" respectively.
307: .PP
308: .IP \fIi\|\fP:n
309: skip to the \fIi\|\fP-th next file given in the command line
310: (skips to last file if n doesn't make sense)
311: .PP
312: .IP \fIi\|\fP:p
313: skip to the \fIi\|\fP-th previous file given in the command line.
314: If this command is given in the middle of printing out a
315: file, then
316: .I more
317: goes back to the beginning of the file. If \fIi\fP doesn't make sense,
318: .I more
319: skips back to the first file.
320: If
321: .I more
322: is not reading from a file, the bell is rung and nothing else happens.
323: .PP
324: .IP :f
325: display the current file name and line number.
326: .PP
327: .IP ":q or :Q"
1.8 ! aaron 328: exit from
1.3 etheisen 329: .I more
330: (same as q or Q).
331: .PP
332: .IP .
333: (dot) repeat the previous command.
334: .PP
335: The commands take effect immediately, i.e., it is not necessary to
336: type a carriage return.
337: Up to the time when the command character itself is given,
338: the user may hit the line kill character to cancel the numerical
339: argument being formed.
340: In addition, the user may hit the erase character to redisplay the
1.6 etheisen 341: filename (xx%) message.
1.3 etheisen 342: .PP
343: At any time when output is being sent to the terminal, the user can
344: hit the quit key (normally control\-\\).
345: .I More
1.6 etheisen 346: will stop sending output, and will display the usual
347: .I filename
1.3 etheisen 348: prompt.
349: The user may then enter one of the above commands in the normal manner.
350: Unfortunately, some output is lost when this is done, due to the
351: fact that any characters waiting in the terminal's output queue
352: are flushed when the quit signal occurs.
353: .PP
354: The terminal is set to
355: .I noecho
356: mode by this program so that the output can be continuous.
357: What you type will thus not show on your terminal, except for the / and !
358: commands.
359: .PP
360: If the standard output is not a teletype, then
361: .I more
362: acts just like
363: .I cat,
364: except that a header is printed before each file (if there is
365: more than one).
366: .PP
367: .DT
368: A sample usage of
369: .I more
370: in previewing
371: .I nroff
372: output would be
373: .PP
374: nroff \-ms +2 doc.n | more -s
375: .SH FILES
376: .DT
1.4 etheisen 377: /usr/share/misc/termcap Terminal data base
1.3 etheisen 378: .br
1.4 etheisen 379: /usr/share/misc/more.help Help file
1.3 etheisen 380: .SH "SEE ALSO"
381: csh(1), man(1), msgs(1), script(1), sh(1), environ(7)
382: .SH BUGS
383: Skipping backwards is too slow on large files.