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