add .Vx so tmac.andoc will call tmac.mdoc-old
[unix-history] / usr / src / usr.bin / more / more.1
CommitLineData
b5dc1377 1.\" Copyright (c) 1988, 1990 The Regents of the University of California.
bfe13c81 2.\" Copyright (c) 1988 Mark Nudleman
bfe13c81
KB
3.\" All rights reserved.
4.\"
b5dc1377 5.\" %sccs.include.redist.man%
bfe13c81 6.\"
d0719240 7.\" @(#)more.1 5.14 (Berkeley) %G%
bfe13c81 8.\"
b5dc1377
CL
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
410c1f41
KB
24is a filter for paging through text one screenful at a time. It
25uses
b5dc1377 26.Xr termcap 3
410c1f41
KB
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.)
b5dc1377 30.Ar File
410c1f41 31may be a single dash (``-''), implying stdin.
b5dc1377 32.Sh OPTIONS
410c1f41 33Command line options are described below.
b5dc1377
CL
34Options are also taken from the environment variable
35.Ev MORE
410c1f41
KB
36(make sure to precede them with a dash (``-'')) but command
37line options will override them.
b5dc1377
CL
38.Tw Fl
39.Tp Fl c
40Normally,
41.Nm more
410c1f41 42will repaint the screen by scrolling from the bottom of the screen.
b5dc1377
CL
43If the
44.Fl c
45option is set, when
46.Nm more
410c1f41 47needs to change the entire display, it will paint from the top line down.
b5dc1377 48.Tp Fl e
00f91e6d 49Normally, if displaying a single file,
b5dc1377
CL
50.Nm more
51exits as soon as it reaches end-of-file. The
52.Fl e
53option tells more to
00f91e6d
KB
54exit if it reaches end-of-file twice without an intervening operation.
55If the file is shorter than a single screen
b5dc1377 56.Nm more
00f91e6d 57will exit at end-of-file regardless.
b5dc1377
CL
58.Tp Fl i
59The
60.Fl i
61option causes searches to ignore case; that is,
410c1f41 62uppercase and lowercase are considered identical.
b5dc1377
CL
63.Tp Fl n
64The
65.Fl n
66flag suppresses line numbers.
410c1f41 67The default (to use line numbers) may cause
b5dc1377 68.Nm more
410c1f41 69to run more slowly in some cases, especially with a very large input file.
b5dc1377
CL
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
5325ced3
CL
74.Cm =
75command, and the
76.Cm v
77command will pass the current line number to the editor.
b5dc1377
CL
78.Tp Fl s
79The
80.Fl s
81option causes
410c1f41 82consecutive blank lines to be squeezed into a single blank line.
b5dc1377
CL
83.Tp Fl t
84The
85.Fl t
86option, followed immediately by a tag, will edit the file
410c1f41 87containing that tag. For more information, see the
b5dc1377 88.Xr ctags 1
410c1f41 89command.
b5dc1377 90.Tp Fl u
dacf700d 91By default,
b5dc1377 92.Nm more
dacf700d
KB
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
b5dc1377
CL
97character. The
98.Fl u
99option causes backspaces to always be displayed as
dacf700d
KB
100control characters, i.e. as the two character sequence ``^H'', and CR-LF
101to be left alone.
b5dc1377
CL
102.Tp Fl x
103The
104.Fl x
105option sets tab stops every
106.Ar N
410c1f41 107positions. The default for
b5dc1377 108.Ar N
410c1f41 109is 8.
b5dc1377
CL
110.Tp Fl \&/
111The
112.Fl \&/
113option specifies a string that will be searched for before
410c1f41 114each file is displayed.
b5dc1377 115.Sh COMMANDS
410c1f41 116Interactive commands for
b5dc1377 117.Nm more
410c1f41 118are based on
b5dc1377 119.Xr vi 1 .
410c1f41
KB
120Some commands may be preceeded by a decimal number, called N in the
121descriptions below.
bfe13c81 122In the following descriptions, ^X means control-X.
b5dc1377
CL
123.Pp
124.Tw Ic
125.Tp Ic h
410c1f41 126help: display a summary of these commands.
bfe13c81 127If you forget all the other commands, remember this one.
b5dc1377
CL
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
410c1f41 138Scroll forward N lines, default one window.
bfe13c81 139If N is more than the screen size, only the final screenful is displayed.
b5dc1377
CL
140.Tp Cx Ic b
141.Ws
142.Cx or
143.Ws
144.Ic \&^B
145.Cx
bfe13c81
KB
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.
b5dc1377
CL
148.Tp Cx Ic j
149.Ws
150.Cx or
151.Ws
152.Ic RETURN
153.Cx
bfe13c81
KB
154Scroll forward N lines, default 1.
155The entire N lines are displayed, even if N is more than the screen size.
b5dc1377 156.Tp Ic k
bfe13c81
KB
157Scroll backward N lines, default 1.
158The entire N lines are displayed, even if N is more than the screen size.
5325ced3 159.Tp Cx Ic d
b5dc1377
CL
160.Ws
161.Cx or
162.Ws
163.Ic \&^D
164.Cx
bfe13c81 165Scroll forward N lines, default one half of the screen size.
b5dc1377 166If N is specified, it becomes the new default for
bfe13c81 167subsequent d and u commands.
5325ced3 168.Tp Cx Ic u
b5dc1377
CL
169.Ws
170.Cx or
171.Ws
172.Ic \&^U
173.Cx
bfe13c81 174Scroll backward N lines, default one half of the screen size.
b5dc1377 175If N is specified, it becomes the new default for
bfe13c81 176subsequent d and u commands.
b5dc1377 177.Tp Ic g
bfe13c81 178Go to line N in the file, default 1 (beginning of file).
b5dc1377 179.Tp Ic G
bfe13c81 180Go to line N in the file, default the end of the file.
5325ced3 181.Tp Cx Ic p
b5dc1377
CL
182.Ws
183.Cx or
184.Ws
185.Ic \&%
186.Cx
410c1f41
KB
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
b5dc1377 189.Nm more
410c1f41
KB
190has already read to the end of the file. It is always fast, but
191not always useful.)
5325ced3 192.Tp Cx Ic r
b5dc1377
CL
193.Ws
194.Cx or
195.Ws
196.Ic \&^L
197.Cx
410c1f41 198Repaint the screen.
b5dc1377 199.Tp Ic R
410c1f41
KB
200Repaint the screen, discarding any buffered input.
201Useful if the file is changing while it is being viewed.
b5dc1377
CL
202.Tp Ic m
203Followed by any lowercase letter,
bfe13c81 204marks the current position with that letter.
b5dc1377 205.Tp Ic \&\'
bfe13c81
KB
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
148d5db7
KB
210which the last "large" movement command was executed, or the
211beginning of the file if no such movements have occurred.
bfe13c81 212All marks are lost when a new file is examined.
b5dc1377
CL
213.Tp Cx Ic \&/
214.Ar pattern
215.Cx
bfe13c81
KB
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
b5dc1377 219.Xr ed .
410c1f41 220The search starts at the second line displayed.
5325ced3 221.Tp Cx Ic \&\?
b5dc1377
CL
222.Ar pattern
223.Cx
bfe13c81
KB
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.
5325ced3 226.Tp Cx Ic \&/\&!
b5dc1377
CL
227.Ar pattern
228.Cx
bfe13c81
KB
229Like /, but the search is for the N-th line
230which does NOT contain the pattern.
5325ced3 231.Tp Cx Ic \&?\&!
b5dc1377
CL
232.Ar pattern
233.Cx
bfe13c81
KB
234Like ?, but the search is for the N-th line
235which does NOT contain the pattern.
b5dc1377 236.Tp Ic n
bfe13c81
KB
237Repeat previous search, for N-th line containing the last pattern
238(or NOT containing the last pattern, if the previous search
239was /! or ?!).
b5dc1377
CL
240.Tp Cx Ic E
241.Ws
242.Op Ar filename
243.Cx
bfe13c81
KB
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.
b5dc1377
CL
249.Tp Cx Ic N
250.Ws
251.Cx or
252.Ws
253.Ic \&:n
254.Cx
bfe13c81
KB
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.
b5dc1377
CL
258.Tp Cx Ic P
259.Ws
260.Cx or
261.Ws
262.Ic \&:p
263.Cx
bfe13c81
KB
264Examine the previous file.
265If a number N is specified, the N-th previous file is examined.
b5dc1377 266.Tp Ic \&:t
410c1f41 267Go to supplied tag.
b5dc1377 268.Tp Ic v
bfe13c81 269Invokes an editor to edit the current file being viewed.
b5dc1377
CL
270The editor is taken from the environment variable
271.Ev EDITOR ,
410c1f41 272or defaults to
b5dc1377
CL
273.Xr vi 1 .
274.Tp Cx Ic \&=
275.Ws
276.Cx or
277.Ws
278.Ic \&^G
279.Cx
410c1f41 280These options print out the number of the file currently being displayed
6d713a99
KB
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
b5dc1377 284.Nm more
6d713a99
KB
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.
b5dc1377
CL
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
410c1f41 298Exits
b5dc1377
CL
299.Nm more .
300.Tp
301.Sh ENVIRONMENT
302.Nm More
5325ced3
CL
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
b5dc1377
CL
316.Sh SEE ALSO
317.Xr ctags 1 ,
318.Xr vi 1
319.Sh AUTHOR
410c1f41
KB
320This software is derived from software contributed to Berkeley
321by Mark Nudleman.
b5dc1377
CL
322.Sh HISTORY
323.Nm more
324appeared in 3 BSD.