Annotation of src/usr.bin/less/more.1, Revision 1.17
1.17 ! jmc 1: .\" $OpenBSD: more.1,v 1.16 2014/04/25 18:07:41 schwarze Exp $
1.1 millert 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: .\"
1.16 schwarze 32: .Dd $Mdocdate: April 25 2014 $
1.1 millert 33: .Dt MORE 1
34: .Os
35: .Sh NAME
36: .Nm more
1.3 jmc 37: .Nd view files
1.1 millert 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
1.16 schwarze 46: The
1.2 jmc 47: .Nm
1.16 schwarze 48: pager displays text one screenful at a time.
49: After showing each screenful, it prompts the user for a command.
50: Most commands scroll the text or move to a different place
51: in the file, while some switch to another file.
1.1 millert 52: If no
53: .Ar file
54: is specified, or if
55: .Ar file
56: is a single dash
57: .Pq Ql - ,
58: the standard input is used.
59: .Pp
1.16 schwarze 60: When showing the last line of a file,
61: .Nm
62: displays a prompt indicating end of file and the name of the next file
63: to examine, if any.
64: It then waits for input from the user.
65: Scrolling forward switches to the next file,
66: or exits if there is none.
67: .Pp
68: This version of
69: .Nm
70: is actually
1.15 jmc 71: .Xr less 1
72: in disguise.
73: As such, it will also accept options documented in
74: .Xr less 1 .
75: This manual page describes only features
76: relevant to a POSIX compliant
77: .Nm .
78: .Pp
1.1 millert 79: The options are as follows:
80: .Bl -tag -width Ds
81: .It Fl c
1.3 jmc 82: When changing the display, paint from the top line down.
83: The default is to scroll from the bottom of the screen.
1.1 millert 84: .It Fl e
1.16 schwarze 85: Exit immediately after showing the last line of the last file,
86: without prompting the user for a command first.
1.1 millert 87: .It Fl i
1.3 jmc 88: Ignore case.
89: Upper case and lower case are considered identical.
1.1 millert 90: .It Fl n Ar number
1.3 jmc 91: Page
1.1 millert 92: .Ar number
93: of lines per screenful.
94: By default,
95: .Nm
1.3 jmc 96: uses the terminal window size.
1.1 millert 97: .It Fl p Ar command
98: Execute the specified
99: .Nm
1.9 jmc 100: commands when a file is first examined (or re-examined, such as with the
1.8 millert 101: .Ic :e
102: or
103: .Ic :p
104: commands).
1.13 schwarze 105: Multiple commands have to be concatenated into one single argument.
106: Search patterns may contain blank characters and can be terminated
107: by newline characters embedded in the
108: .Ar command
109: argument.
110: Any other blank and newline characters contained in the argument are
111: interpreted as
112: .Ic SPACE
113: and
114: .Ic RETURN
115: commands, respectively.
1.1 millert 116: .It Fl s
1.3 jmc 117: Squeeze consecutive blank lines into a single blank line.
1.2 jmc 118: .It Fl t Ar tag
1.11 schwarze 119: Examine the file containing
1.3 jmc 120: .Ar tag .
121: For more information, see
122: .Xr ctags 1 .
1.1 millert 123: .It Fl u
1.3 jmc 124: Display backspaces as control characters
125: .Pq Sq ^H
126: and leave CR-LF sequences alone.
1.1 millert 127: By default,
128: .Nm
1.3 jmc 129: treats backspaces and CR-LF sequences specially:
130: backspaces which appear adjacent to an underscore character are
131: displayed as underlined text;
132: backspaces which appear between two identical characters are displayed
133: as emboldened text;
134: and CR-LF sequences are compressed to a single linefeed character.
1.2 jmc 135: .El
1.1 millert 136: .Sh COMMANDS
137: Interactive commands for
138: .Nm
139: are based on
140: .Xr vi 1 .
141: Some commands may be preceded by a decimal number, called N in the
142: descriptions below.
143: In the following descriptions, ^X means control-X.
144: .Bl -tag -width Ic
145: .It Ic h
146: Help: display a summary of these commands.
1.10 jmc 147: .It Ic SPACE | f | ^F
1.1 millert 148: Scroll forward N lines, default one window.
149: If N is more than the screen size, only the final screenful is displayed.
1.10 jmc 150: .It Ic b | ^B
151: Scroll backward N lines, default one window (see the
152: .Fl n
153: option).
1.1 millert 154: If N is more than the screen size, only the final screenful is displayed.
1.10 jmc 155: .It Ic j | RETURN
1.1 millert 156: Scroll forward N lines, default 1.
157: The entire N lines are displayed, even if N is more than the screen size.
158: .It Ic k
159: Scroll backward N lines, default 1.
160: The entire N lines are displayed, even if N is more than the screen size.
1.10 jmc 161: .It Ic d | ^D
1.1 millert 162: Scroll forward N lines, default one half of the screen size.
163: If N is specified, it becomes the new default for
164: subsequent d and u commands.
1.10 jmc 165: .It Ic u | ^U
1.1 millert 166: Scroll backward N lines, default one half of the screen size.
167: If N is specified, it becomes the new default for
168: subsequent d and u commands.
169: .It Ic g
170: Go to line N in the file, default 1 (beginning of file).
171: .It Ic G
172: Go to line N in the file, default the end of the file.
1.10 jmc 173: .It Ic r | ^L
1.1 millert 174: Repaint the screen.
175: .It Ic R
176: Repaint the screen, discarding any buffered input.
177: Useful if the file is changing while it is being viewed.
178: .It Ic m
179: Followed by any lowercase letter,
180: marks the current position with that letter.
1.2 jmc 181: .It Ic '
1.1 millert 182: (Single quote.)
183: Followed by any lowercase letter, returns to the position which
184: was previously marked with that letter.
185: Followed by another single quote, returns to the position at
186: which the last "large" movement command was executed, or the
187: beginning of the file if no such movements have occurred.
188: All marks are lost when a new file is examined.
1.2 jmc 189: .It Ic / Ns Ar pattern
1.1 millert 190: Search forward in the file for the N-th line containing the pattern.
191: N defaults to 1.
1.12 millert 192: The pattern is a basic regular expression (BRE).
193: See
194: .Xr re_format 7
195: for more information on regular expressions.
1.1 millert 196: The search starts at the second line displayed.
1.2 jmc 197: .It Ic ?\& Ns Ar pattern
1.1 millert 198: Search backward in the file for the N-th line containing the pattern.
199: The search starts at the line immediately before the top line displayed.
1.2 jmc 200: .It Ic /! Ns Ar pattern
1.1 millert 201: Like /, but the search is for the N-th line
202: which does NOT contain the pattern.
1.2 jmc 203: .It Ic ?! Ns Ar pattern
1.1 millert 204: Like ?, but the search is for the N-th line
205: which does NOT contain the pattern.
206: .It Ic n
207: Repeat previous search, for N-th line containing the last pattern
1.2 jmc 208: (or NOT containing the last pattern,
209: if the previous search was /! or ?!).
1.1 millert 210: .It Ic N
211: Repeat previous search in the opposite direction,
1.2 jmc 212: for N-th line containing the last pattern
213: (or NOT containing the last pattern,
214: if the previous search was /! or ?!).
1.5 jmc 215: .It Ic :e Op Ar filename
1.1 millert 216: Examine a new file.
1.5 jmc 217: If the filename is missing, the "current" file (see the
218: .Ic :n
219: and
220: .Ic :p
221: commands below)
222: from the list of files in the command line is re-examined.
1.1 millert 223: If the filename is a pound sign (#), the previously examined file is
224: re-examined.
1.2 jmc 225: .It Ic :n
1.1 millert 226: Examine the next file (from the list of files given in the command line).
227: If a number N is specified (not to be confused with the command N),
228: the N-th next file is examined.
1.5 jmc 229: .It Ic :p
1.1 millert 230: Examine the previous file.
231: If a number N is specified, the N-th previous file is examined.
1.2 jmc 232: .It Ic :t
1.1 millert 233: Go to supplied tag.
234: .It Ic v
235: Invokes an editor to edit the current file being viewed.
236: The editor is taken from the environment variable
237: .Ev EDITOR ,
238: or defaults to
1.2 jmc 239: .Xr vi 1 .
1.10 jmc 240: .It Ic = | ^G
1.1 millert 241: These options print out the number of the file currently being displayed
242: relative to the total number of files there are to display, the current
243: line number, the current byte number and the total bytes to display, and
244: what percentage of the file has been displayed.
245: If
246: .Nm
247: is reading from the standard input,
248: or the file is shorter than a single screen, some
249: of these items may not be available.
250: Note, all of these items reference the first byte of the last line
251: displayed on the screen.
1.10 jmc 252: .It Ic q | :q | ZZ
1.1 millert 253: Exits
254: .Nm .
255: .El
256: .Sh ENVIRONMENT
1.4 jmc 257: .Bl -tag -width "COLUMNSXXX"
258: .It Ev COLUMNS
259: Sets the number of columns on the screen.
260: Takes precedence over the number of columns specified by the
261: .Ev TERM
262: variable,
263: but may be overridden by window systems which support
264: .Dv TIOCGWINSZ .
1.1 millert 265: .It Ev EDITOR
1.10 jmc 266: Specifies the default editor.
267: If not set,
1.1 millert 268: .Xr vi 1
269: is used.
1.4 jmc 270: .It Ev LINES
271: Sets the number of lines on the screen.
272: Takes precedence over the number of lines specified by the TERM variable,
273: but may be overridden by window systems which support
274: .Dv TIOCGWINSZ .
1.1 millert 275: .It Ev MORE
276: Default command line options to use with
277: .Nm .
278: The options should be space-separated and must be prefixed with a dash
279: .Pq Ql - .
280: .It Ev TERM
1.4 jmc 281: Specifies the terminal type.
282: Used by
283: .Nm
284: to get the terminal characteristics necessary to manipulate the screen.
1.1 millert 285: .El
1.6 jmc 286: .Sh EXIT STATUS
287: .Ex -std more
1.13 schwarze 288: .Sh EXAMPLES
289: Examine the ends of all files in the current directory, showing line
290: and byte counts for each:
291: .Pp
292: .Dl $ more -p G= *
293: .Pp
294: Examine several manual pages, starting from the options description
295: in the DESCRIPTION section:
296: .Bd -literal -offset indent
297: $ more -p '/DESCRIPTION
298: > /options
299: > ' *.1
300: .Ed
1.1 millert 301: .Sh SEE ALSO
302: .Xr ctags 1 ,
303: .Xr less 1 ,
1.12 millert 304: .Xr vi 1 ,
305: .Xr re_format 7
1.1 millert 306: .Sh STANDARDS
307: The
308: .Nm
309: utility is compliant with the
310: .St -p1003.1-2008
311: specification,
312: though its presence is optional.
313: .Pp
1.7 jmc 314: Functionality allowing the user to skip (as opposed to scroll)
315: forward is not currently implemented.
1.1 millert 316: .Sh HISTORY
317: A
318: .Nm
319: command appeared in
320: .Bx 3.0 .
1.2 jmc 321: .Sh AUTHORS
322: .An Mark Nudelman Aq Mt markn@greenwoodsoftware.com