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