xref: /original-bsd/usr.bin/more/more.1 (revision c8876cb1)
1.\" Copyright (c) 1988, 1990 The Regents of the University of California.
2.\" Copyright (c) 1988 Mark Nudleman
3.\" All rights reserved.
4.\"
5.\" %sccs.include.redist.man%
6.\"
7.\"     @(#)more.1	5.13 (Berkeley) 07/24/90
8.\"
9.Dd
10.Dt MORE 1
11.Sh NAME
12.Nm more
13.Nd file perusal filter for crt viewing
14.Sh SYNOPSIS
15.Nm more
16.Op Fl ceinus
17.Op Fl t Ar tag
18.Op Fl x Ar tabs
19.Op Fl / Ar pattern
20.Op Fl #
21.Ar
22.Sh DESCRIPTION
23.Nm More
24is a filter for paging through text one screenful at a time.  It
25uses
26.Xr termcap  3
27so it can run on a variety of terminals.  There is even limited support
28for hardcopy terminals.  (On a hardcopy terminal, lines which should be
29printed at the top of the screen are prefixed with an up-arrow.)
30.Ar File
31may be a single dash (``-''), implying stdin.
32.Sh OPTIONS
33Command line options are described below.
34Options are also taken from the environment variable
35.Ev MORE
36(make sure to precede them with a dash (``-'')) but command
37line options will override them.
38.Tw Fl
39.Tp Fl c
40Normally,
41.Nm more
42will repaint the screen by scrolling from the bottom of the screen.
43If the
44.Fl c
45option is set, when
46.Nm more
47needs to change the entire display, it will paint from the top line down.
48.Tp Fl e
49Normally, if displaying a single file,
50.Nm more
51exits as soon as it reaches end-of-file.  The
52.Fl e
53option tells more to
54exit if it reaches end-of-file twice without an intervening operation.
55If the file is shorter than a single screen
56.Nm more
57will exit at end-of-file regardless.
58.Tp Fl i
59The
60.Fl i
61option causes searches to ignore case; that is,
62uppercase and lowercase are considered identical.
63.Tp Fl n
64The
65.Fl n
66flag suppresses line numbers.
67The default (to use line numbers) may cause
68.Nm more
69to run more slowly in some cases, especially with a very large input file.
70Suppressing line numbers with the
71.Fl n
72flag will avoid this problem.
73Using line numbers means: the line number will be displayed in the
74.Cm =
75command, and the
76.Cm v
77command will pass the current line number to the editor.
78.Tp Fl s
79The
80.Fl s
81option causes
82consecutive blank lines to be squeezed into a single blank line.
83.Tp Fl t
84The
85.Fl t
86option, followed immediately by a tag, will edit the file
87containing that tag.  For more information, see the
88.Xr ctags  1
89command.
90.Tp Fl u
91By default,
92.Nm more
93treats backspaces and CR-LF sequences specially.  Backspaces which appear
94adjacent to an underscore character are displayed as underlined text.
95Backspaces which appear between two identical characters are displayed
96as emboldened text.  CR-LF sequences are compressed to a single linefeed
97character.  The
98.Fl u
99option causes backspaces to always be displayed as
100control characters, i.e. as the two character sequence ``^H'', and CR-LF
101to be left alone.
102.Tp Fl x
103The
104.Fl x
105option sets tab stops every
106.Ar N
107positions. The default for
108.Ar N
109is 8.
110.Tp Fl \&/
111The
112.Fl \&/
113option specifies a string that will be searched for before
114each file is displayed.
115.Sh COMMANDS
116Interactive commands for
117.Nm more
118are based on
119.Xr vi  1  .
120Some commands may be preceeded by a decimal number, called N in the
121descriptions below.
122In the following descriptions, ^X means control-X.
123.Pp
124.Tw Ic
125.Tp Ic h
126help: display a summary of these commands.
127If you forget all the other commands, remember this one.
128.Tp Cx Ic SPACE
129.Ws
130.Cx or
131.Ws
132.Ic f
133.Ws
134.Cx or
135.Ws
136.Ic \&^F
137.Cx
138Scroll forward N lines, default one window.
139If N is more than the screen size, only the final screenful is displayed.
140.Tp Cx Ic b
141.Ws
142.Cx or
143.Ws
144.Ic \&^B
145.Cx
146Scroll backward N lines, default one window (see option -z below).
147If N is more than the screen size, only the final screenful is displayed.
148.Tp Cx Ic j
149.Ws
150.Cx or
151.Ws
152.Ic RETURN
153.Cx
154Scroll forward N lines, default 1.
155The entire N lines are displayed, even if N is more than the screen size.
156.Tp Ic k
157Scroll backward N lines, default 1.
158The entire N lines are displayed, even if N is more than the screen size.
159.Tp Cx Ic d
160.Ws
161.Cx or
162.Ws
163.Ic \&^D
164.Cx
165Scroll forward N lines, default one half of the screen size.
166If N is specified, it becomes the new default for
167subsequent d and u commands.
168.Tp Cx Ic u
169.Ws
170.Cx or
171.Ws
172.Ic \&^U
173.Cx
174Scroll backward N lines, default one half of the screen size.
175If N is specified, it becomes the new default for
176subsequent d and u commands.
177.Tp Ic g
178Go to line N in the file, default 1 (beginning of file).
179.Tp Ic G
180Go to line N in the file, default the end of the file.
181.Tp Cx Ic p
182.Ws
183.Cx or
184.Ws
185.Ic \&%
186.Cx
187Go to a position N percent into the file.  N should be between 0
188and 100.  (This works if standard input is being read, but only if
189.Nm more
190has already read to the end of the file.  It is always fast, but
191not always useful.)
192.Tp Cx Ic r
193.Ws
194.Cx or
195.Ws
196.Ic \&^L
197.Cx
198Repaint the screen.
199.Tp Ic R
200Repaint the screen, discarding any buffered input.
201Useful if the file is changing while it is being viewed.
202.Tp Ic m
203Followed by any lowercase letter,
204marks the current position with that letter.
205.Tp Ic \&\'
206(Single quote.)
207Followed by any lowercase letter, returns to the position which
208was previously marked with that letter.
209Followed by another single quote, returns to the postion at
210which the last "large" movement command was executed, or the
211beginning of the file if no such movements have occurred.
212All marks are lost when a new file is examined.
213.Tp Cx Ic \&/
214.Ar pattern
215.Cx
216Search forward in the file for the N-th line containing the pattern.
217N defaults to 1.
218The pattern is a regular expression, as recognized by
219.Xr ed .
220The search starts at the second line displayed.
221.Tp Cx Ic \&\?
222.Ar pattern
223.Cx
224Search backward in the file for the N-th line containing the pattern.
225The search starts at the line immediately before the top line displayed.
226.Tp Cx Ic \&/\&!
227.Ar pattern
228.Cx
229Like /, but the search is for the N-th line
230which does NOT contain the pattern.
231.Tp Cx Ic \&?\&!
232.Ar pattern
233.Cx
234Like ?, but the search is for the N-th line
235which does NOT contain the pattern.
236.Tp Ic n
237Repeat previous search, for N-th line containing the last pattern
238(or NOT containing the last pattern, if the previous search
239was /! or ?!).
240.Tp Cx Ic E
241.Ws
242.Op Ar filename
243.Cx
244Examine a new file.
245If the filename is missing, the "current" file (see the N and P commands
246below) from the list of files in the command line is re-examined.
247If the filename is a pound sign (#), the previously examined file is
248re-examined.
249.Tp Cx Ic N
250.Ws
251.Cx or
252.Ws
253.Ic \&:n
254.Cx
255Examine the next file (from the list of files given in the command line).
256If a number N is specified (not to be confused with the command N),
257the N-th next file is examined.
258.Tp Cx Ic P
259.Ws
260.Cx or
261.Ws
262.Ic \&:p
263.Cx
264Examine the previous file.
265If a number N is specified, the N-th previous file is examined.
266.Tp Ic \&:t
267Go to supplied tag.
268.Tp Ic v
269Invokes an editor to edit the current file being viewed.
270The editor is taken from the environment variable
271.Ev EDITOR ,
272or defaults to
273.Xr vi  1  .
274.Tp Cx Ic \&=
275.Ws
276.Cx or
277.Ws
278.Ic \&^G
279.Cx
280These options print out the number of the file currently being displayed
281relative to the total number of files there are to display, the current
282line number, the current byte number and the total bytes to display, and
283what percentage of the file has been displayed.  If
284.Nm more
285is reading from stdin, or the file is shorter than a single screen, some
286of these items may not be available.  Note, all of these items reference
287the first byte of the last line displayed on the screen.
288.Tp Cx Ic q
289.Ws
290.Cx or
291.Ws
292.Ic \&:q
293.Ws
294.Cx or
295.Ws
296.Ic ZZ
297.Cx
298Exits
299.Nm more .
300.Tp
301.Sh ENVIRONMENT
302.Nm More
303utilizes the following environment variables, if they exist:
304.Tw Fl
305.Tp Ev MORE
306This variable may be set with favored options to
307.Nm more .
308.Tp Ev EDITOR
309Specify default editor.
310.Tp Ev SHELL
311Current shell in use (normally set by the shell at login time).
312.Tp Ev TERM
313Specifies terminal type, used by more to get the terminal
314characteristics necessary to manipulate the screen.
315.Tp
316.Sh SEE ALSO
317.Xr ctags 1 ,
318.Xr vi 1
319.Sh AUTHOR
320This software is derived from software contributed to Berkeley
321by Mark Nudleman.
322.Sh HISTORY
323.Nm more
324appeared in 3 BSD.
325