This commit was generated by cvs2svn to track changes on a CVS vendor
[unix-history] / usr.bin / more / more.1
CommitLineData
2ec5f51d
NW
1.\" Copyright (c) 1988, 1990 The Regents of the University of California.
2.\" Copyright (c) 1988 Mark Nudleman
15637ed4
RG
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright
9.\" notice, this list of conditions and the following disclaimer.
10.\" 2. Redistributions in binary form must reproduce the above copyright
11.\" notice, this list of conditions and the following disclaimer in the
12.\" documentation and/or other materials provided with the distribution.
13.\" 3. All advertising materials mentioning features or use of this software
14.\" must display the following acknowledgement:
15.\" This product includes software developed by the University of
16.\" California, Berkeley and its contributors.
17.\" 4. Neither the name of the University nor the names of its contributors
18.\" may be used to endorse or promote products derived from this software
19.\" without specific prior written permission.
20.\"
21.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31.\" SUCH DAMAGE.
32.\"
2ec5f51d 33.\" @(#)more.1 5.15 (Berkeley) 7/29/91
15637ed4 34.\"
2ec5f51d
NW
35.Dd July 29, 1991
36.Dt MORE 1
37.Os
38.Sh NAME
39.Nm more
40.Nd file perusal filter for crt viewing
41.Sh SYNOPSIS
42.Nm more
43.Op Fl ceinus
44.Op Fl t Ar tag
45.Op Fl x Ar tabs
46.Op Fl / Ar pattern
47.Op Fl #
48.Op Ar
49.Sh DESCRIPTION
50.Nm More
51is a filter for paging through text one screenful at a time. It
52uses
53.Xr termcap 3
54so it can run on a variety of terminals. There is even limited support
55for hardcopy terminals. (On a hardcopy terminal, lines which should be
56printed at the top of the screen are prefixed with an up-arrow.)
57.Ar File
58may be a single dash (``-''), implying stdin.
59.Sh OPTIONS
60Command line options are described below.
61Options are also taken from the environment variable
62.Ev MORE
63(make sure to precede them with a dash (``-'')) but command
64line options will override them.
65.Bl -tag -width flag
66.It Fl c
15637ed4 67Normally,
2ec5f51d
NW
68.Nm more
69will repaint the screen by scrolling from the bottom of the screen.
70If the
71.Fl c
72option is set, when
73.Nm more
74needs to change the entire display, it will paint from the top line down.
75.It Fl e
76Normally, if displaying a single file,
77.Nm more
78exits as soon as it reaches end-of-file. The
79.Fl e
80option tells more to
81exit if it reaches end-of-file twice without an intervening operation.
82If the file is shorter than a single screen
83.Nm more
84will exit at end-of-file regardless.
85.It Fl i
86The
87.Fl i
88option causes searches to ignore case; that is,
89uppercase and lowercase are considered identical.
90.It Fl n
91The
92.Fl n
93flag suppresses line numbers.
94The default (to use line numbers) may cause
95.Nm more
96to run more slowly in some cases, especially with a very large input file.
97Suppressing line numbers with the
98.Fl n
99flag will avoid this problem.
100Using line numbers means: the line number will be displayed in the
101.Cm =
102command, and the
103.Cm v
104command will pass the current line number to the editor.
105.It Fl s
106The
107.Fl s
108option causes
109consecutive blank lines to be squeezed into a single blank line.
110.It Fl t
111The
112.Fl t
113option, followed immediately by a tag, will edit the file
114containing that tag. For more information, see the
115.Xr ctags 1
116command.
117.It Fl u
118By default,
119.Nm more
120treats backspaces and
121.Dv CR-LF
122sequences specially. Backspaces which appear
123adjacent to an underscore character are displayed as underlined text.
124Backspaces which appear between two identical characters are displayed
125as emboldened text.
126.Dv CR-LF
127sequences are compressed to a single linefeed
128character. The
129.Fl u
130option causes backspaces to always be displayed as
131control characters, i.e. as the two character sequence ``^H'', and
132.Dv CR-LF
133to be left alone.
134.It Fl x
135The
136.Fl x
137option sets tab stops every
138.Ar N
139positions. The default for
140.Ar N
141is 8.
142.It Fl /
143The
144.Fl /
145option specifies a string that will be searched for before
146each file is displayed.
147.Sh COMMANDS
148Interactive commands for
149.Nm more
150are based on
151.Xr vi 1 .
152Some commands may be preceeded by a decimal number, called N in the
153descriptions below.
154In the following descriptions, ^X means control-X.
155.Pp
156.Bl -tag -width Ic
157.It Ic h
158Help: display a summary of these commands.
159If you forget all the other commands, remember this one.
160.It Xo
161.Ic SPACE
162.No or
163.Ic f
164.No or
165.Ic \&^F
166.Xc
167Scroll forward N lines, default one window.
168If N is more than the screen size, only the final screenful is displayed.
169.It Ic b No or Ic \&^B
170Scroll backward N lines, default one window (see option -z below).
171If N is more than the screen size, only the final screenful is displayed.
172.It Ic j No or Ic RETURN
173Scroll forward N lines, default 1.
174The entire N lines are displayed, even if N is more than the screen size.
175.It Ic k
176Scroll backward N lines, default 1.
177The entire N lines are displayed, even if N is more than the screen size.
178.It Ic d No or Ic \&^D
179Scroll forward N lines, default one half of the screen size.
180If N is specified, it becomes the new default for
181subsequent d and u commands.
182.It Ic u No or Ic \&^U
183Scroll backward N lines, default one half of the screen size.
184If N is specified, it becomes the new default for
185subsequent d and u commands.
186.It Ic g
187Go to line N in the file, default 1 (beginning of file).
188.It Ic G
189Go to line N in the file, default the end of the file.
190.It Ic p No or Ic \&%
191Go to a position N percent into the file. N should be between 0
192and 100. (This works if standard input is being read, but only if
193.Nm more
194has already read to the end of the file. It is always fast, but
195not always useful.)
196.It Ic r No or Ic \&^L
197Repaint the screen.
198.It Ic R
199Repaint the screen, discarding any buffered input.
200Useful if the file is changing while it is being viewed.
201.It Ic m
202Followed by any lowercase letter,
203marks the current position with that letter.
204.It Ic \&'
205(Single quote.)
206Followed by any lowercase letter, returns to the position which
207was previously marked with that letter.
208Followed by another single quote, returns to the postion at
209which the last "large" movement command was executed, or the
210beginning of the file if no such movements have occurred.
211All marks are lost when a new file is examined.
9368ffc5
AM
212.It Ic \&! Ns Ar command
213Invoke a shell command. The characters `%', `#', and `!'
214are replaced by the current file name, previous filename
215and previous shell command, respectively. If there is no
216current or previous filename, `%' and `#' are not expanded.
217`\%' `\#' and `\!' are replaced by `%', `#' and `!',
218respectively.
2ec5f51d
NW
219.It Ic \&/ Ns Ar pattern
220Search forward in the file for the N-th line containing the pattern.
221N defaults to 1.
222The pattern is a regular expression, as recognized by
223.Xr ed .
224The search starts at the second line displayed.
225.It Ic \&? Ns Ar pattern
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.It Ic \&/\&! Ns Ar pattern
229Like /, but the search is for the N-th line
230which does NOT contain the pattern.
231.It Ic \&?\&! Ns Ar pattern
232Like ?, but the search is for the N-th line
233which does NOT contain the pattern.
234.It Ic n
235Repeat previous search, for N-th line containing the last pattern
236(or
237.Tn NOT
238containing the last pattern, if the previous search
239was /! or ?!).
240.It Ic E Ns Op Ar filename
241Examine a new file.
242If the filename is missing, the "current" file (see the N and P commands
243below) from the list of files in the command line is re-examined.
244If the filename is a pound sign (#), the previously examined file is
245re-examined.
246.It Ic N No or Ic \&:n
247Examine the next file (from the list of files given in the command line).
248If a number N is specified (not to be confused with the command N),
249the N-th next file is examined.
250.It Ic P No or Ic \&:p
251Examine the previous file.
252If a number N is specified, the N-th previous file is examined.
253.It Ic \&:t
254Go to supplied tag.
255.It Ic v
256Invokes an editor to edit the current file being viewed.
257The editor is taken from the environment variable
258.Ev EDITOR ,
259or defaults to
260.Xr vi 1 .
261.It Ic \&= No or Ic \&^G
262These options print out the number of the file currently being displayed
263relative to the total number of files there are to display, the current
264line number, the current byte number and the total bytes to display, and
265what percentage of the file has been displayed. If
266.Nm more
267is reading from stdin, or the file is shorter than a single screen, some
268of these items may not be available. Note, all of these items reference
269the first byte of the last line displayed on the screen.
270.It Xo
271.Ic q
272.No or
273.Ic \&:q
274.No or
275.Ic ZZ
276.Xc
277Exits
278.Nm more .
279.El
280.Sh ENVIRONMENT
281.Nm More
282utilizes the following environment variables, if they exist:
283.Bl -tag -width Fl
284.It Ev MORE
285This variable may be set with favored options to
286.Nm more .
287.It Ev EDITOR
288Specify default editor.
289.It Ev SHELL
290Current shell in use (normally set by the shell at login time).
291.It Ev TERM
292Specifies terminal type, used by more to get the terminal
293characteristics necessary to manipulate the screen.
294.El
295.Sh SEE ALSO
296.Xr ctags 1 ,
297.Xr vi 1
298.Sh AUTHOR
299This software is derived from software contributed to Berkeley
300by Mark Nudleman.
301.Sh HISTORY
302The
303.Nm more
304command appeared in
305.Bx 3.0 .