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