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