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