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