xref: /openbsd-src/usr.bin/less/more.1 (revision 1ce1cc459e13b88ac6ec79f39a982ca5a449c21d)
1.\"	$OpenBSD: more.1,v 1.18 2019/08/20 11:34:18 jmc Exp $
2.\"
3.\" Copyright (c) 1988, 1990, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors
15.\"    may be used to endorse or promote products derived from this software
16.\"    without specific prior written permission.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE.
29.\"
30.\"	@(#)more.1	8.2 (Berkeley) 4/18/94
31.\"
32.Dd $Mdocdate: August 20 2019 $
33.Dt MORE 1
34.Os
35.Sh NAME
36.Nm more
37.Nd view files
38.Sh SYNOPSIS
39.Nm more
40.Op Fl ceisu
41.Op Fl n Ar number
42.Op Fl p Ar command
43.Op Fl t Ar tag
44.Op Ar
45.Sh DESCRIPTION
46The
47.Nm
48pager displays text one screenful at a time.
49After showing each screenful, it prompts the user for a command.
50Most commands scroll the text or move to a different place
51in the file, while some switch to another file.
52If no
53.Ar file
54is specified, or if
55.Ar file
56is a single dash
57.Pq Ql - ,
58the standard input is used.
59.Pp
60When showing the last line of a file,
61.Nm
62displays a prompt indicating end of file and the name of the next file
63to examine, if any.
64It then waits for input from the user.
65Scrolling forward switches to the next file,
66or exits if there is none.
67.Pp
68The options are as follows:
69.Bl -tag -width Ds
70.It Fl c
71When changing the display, paint from the top line down.
72The default is to scroll from the bottom of the screen.
73.It Fl e
74Exit immediately after showing the last line of the last file,
75without prompting the user for a command first.
76.It Fl i
77Ignore case.
78Upper case and lower case are considered identical.
79.It Fl n Ar number
80Page
81.Ar number
82of lines per screenful.
83By default,
84.Nm
85uses the terminal window size.
86.It Fl p Ar command
87Execute the specified
88.Nm
89commands when a file is first examined (or re-examined, such as with the
90.Ic :e
91or
92.Ic :p
93commands).
94Multiple commands have to be concatenated into one single argument.
95Search patterns may contain blank characters and can be terminated
96by newline characters embedded in the
97.Ar command
98argument.
99Any other blank and newline characters contained in the argument are
100interpreted as
101.Ic SPACE
102and
103.Ic RETURN
104commands, respectively.
105.It Fl s
106Squeeze consecutive blank lines into a single blank line.
107.It Fl t Ar tag
108Examine the file containing
109.Ar tag .
110For more information, see
111.Xr ctags  1 .
112.It Fl u
113Display backspaces as control characters
114.Pq Sq ^H
115and leave CR-LF sequences alone.
116By default,
117.Nm
118treats backspaces and CR-LF sequences specially:
119backspaces which appear adjacent to an underscore character are
120displayed as underlined text;
121backspaces which appear between two identical characters are displayed
122as emboldened text;
123and CR-LF sequences are compressed to a single linefeed character.
124.El
125.Sh COMMANDS
126Interactive commands for
127.Nm
128are based on
129.Xr vi  1  .
130Some commands may be preceded by a decimal number, called N in the
131descriptions below.
132In the following descriptions, ^X means control-X.
133.Bl -tag -width Ic
134.It Ic h
135Help: display a summary of these commands.
136.It Ic SPACE | f | ^F
137Scroll forward N lines, default one window.
138If N is more than the screen size, only the final screenful is displayed.
139.It Ic b | ^B
140Scroll backward N lines, default one window (see the
141.Fl n
142option).
143If N is more than the screen size, only the final screenful is displayed.
144.It Ic j | RETURN
145Scroll forward N lines, default 1.
146The entire N lines are displayed, even if N is more than the screen size.
147.It Ic k
148Scroll backward N lines, default 1.
149The entire N lines are displayed, even if N is more than the screen size.
150.It Ic d | ^D
151Scroll forward N lines, default one half of the screen size.
152If N is specified, it becomes the new default for
153subsequent d and u commands.
154.It Ic u | ^U
155Scroll backward N lines, default one half of the screen size.
156If N is specified, it becomes the new default for
157subsequent d and u commands.
158.It Ic g
159Go to line N in the file, default 1 (beginning of file).
160.It Ic G
161Go to line N in the file, default the end of the file.
162.It Ic r | ^L
163Repaint the screen.
164.It Ic R
165Repaint the screen, discarding any buffered input.
166Useful if the file is changing while it is being viewed.
167.It Ic m
168Followed by any lowercase letter,
169marks the current position with that letter.
170.It Ic '
171(Single quote.)
172Followed by any lowercase letter, returns to the position which
173was previously marked with that letter.
174Followed by another single quote, returns to the position at
175which the last "large" movement command was executed, or the
176beginning of the file if no such movements have occurred.
177All marks are lost when a new file is examined.
178.It Ic / Ns Ar pattern
179Search forward in the file for the N-th line containing the pattern.
180N defaults to 1.
181The pattern is a basic regular expression (BRE).
182See
183.Xr re_format 7
184for more information on regular expressions.
185The search starts at the second line displayed.
186.It Ic ?\& Ns Ar pattern
187Search backward in the file for the N-th line containing the pattern.
188The search starts at the line immediately before the top line displayed.
189.It Ic /! Ns Ar pattern
190Like /, but the search is for the N-th line
191which does NOT contain the pattern.
192.It Ic ?! Ns Ar pattern
193Like ?, but the search is for the N-th line
194which does NOT contain the pattern.
195.It Ic n
196Repeat previous search, for N-th line containing the last pattern
197(or NOT containing the last pattern,
198if the previous search was /! or ?!).
199.It Ic N
200Repeat previous search in the opposite direction,
201for N-th line containing the last pattern
202(or NOT containing the last pattern,
203if the previous search was /! or ?!).
204.It Ic :e Op Ar filename
205Examine a new file.
206If the filename is missing, the "current" file (see the
207.Ic :n
208and
209.Ic :p
210commands below)
211from the list of files in the command line is re-examined.
212If the filename is a pound sign (#), the previously examined file is
213re-examined.
214.It Ic :n
215Examine the next file (from the list of files given in the command line).
216If a number N is specified (not to be confused with the command N),
217the N-th next file is examined.
218.It Ic :p
219Examine the previous file.
220If a number N is specified, the N-th previous file is examined.
221.It Ic :t
222Go to supplied tag.
223.It Ic v
224Invokes an editor to edit the current file being viewed.
225The editor is taken from the environment variable
226.Ev EDITOR ,
227or defaults to
228.Xr vi 1 .
229.It Ic = | ^G
230These options print out the number of the file currently being displayed
231relative to the total number of files there are to display, the current
232line number, the current byte number and the total bytes to display, and
233what percentage of the file has been displayed.
234If
235.Nm
236is reading from the standard input,
237or the file is shorter than a single screen, some
238of these items may not be available.
239Note, all of these items reference the first byte of the last line
240displayed on the screen.
241.It Ic q | :q | ZZ
242Exits
243.Nm .
244.El
245.Sh ENVIRONMENT
246.Bl -tag -width "COLUMNSXXX"
247.It Ev COLUMNS
248Sets the number of columns on the screen.
249Takes precedence over the number of columns specified by the
250.Ev TERM
251variable,
252but may be overridden by window systems which support
253.Dv TIOCGWINSZ .
254.It Ev EDITOR
255Specifies the default editor.
256If not set,
257.Xr vi 1
258is used.
259.It Ev LINES
260Sets the number of lines on the screen.
261Takes precedence over the number of lines specified by the TERM variable,
262but may be overridden by window systems which support
263.Dv TIOCGWINSZ .
264.It Ev MORE
265Default command line options to use with
266.Nm .
267The options should be space-separated and must be prefixed with a dash
268.Pq Ql - .
269.It Ev TERM
270Specifies the terminal type.
271Used by
272.Nm
273to get the terminal characteristics necessary to manipulate the screen.
274.El
275.Sh EXIT STATUS
276.Ex -std more
277.Sh EXAMPLES
278Examine the ends of all files in the current directory, showing line
279and byte counts for each:
280.Pp
281.Dl $ more -p G= *
282.Pp
283Examine several manual pages, starting from the options description
284in the DESCRIPTION section:
285.Bd -literal -offset indent
286$ more -p '/DESCRIPTION
287> /options
288> ' *.1
289.Ed
290.Sh SEE ALSO
291.Xr ctags 1 ,
292.Xr less 1 ,
293.Xr vi 1 ,
294.Xr re_format 7
295.Sh STANDARDS
296The
297.Nm
298utility is compliant with the
299.St -p1003.1-2008
300specification,
301though its presence is optional.
302.Pp
303Functionality allowing the user to skip (as opposed to scroll)
304forward is not currently implemented.
305.Sh HISTORY
306A
307.Nm
308command appeared in
309.Bx 3.0 .
310The present implementation is actually
311.Xr less 1
312in disguise.
313.Sh AUTHORS
314.An Mark Nudelman
315