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