Annotation of src/usr.bin/less/more.1, Revision 1.10
1.10 ! jmc 1: .\" $OpenBSD: more.1,v 1.9 2014/04/10 06:42:21 jmc 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.10 ! jmc 32: .Dd $Mdocdate: April 10 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.3 jmc 92: Edit the file containing
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.
173: The pattern is a regular expression, as recognized by
1.2 jmc 174: .Xr ed 1 .
1.1 millert 175: The search starts at the second line displayed.
1.2 jmc 176: .It Ic ?\& Ns Ar pattern
1.1 millert 177: Search backward in the file for the N-th line containing the pattern.
178: The search starts at the line immediately before the top line displayed.
1.2 jmc 179: .It Ic /! Ns Ar pattern
1.1 millert 180: Like /, but the search is for the N-th line
181: which does NOT contain the pattern.
1.2 jmc 182: .It Ic ?! Ns Ar pattern
1.1 millert 183: Like ?, but the search is for the N-th line
184: which does NOT contain the pattern.
185: .It Ic n
186: Repeat previous search, for N-th line containing the last pattern
1.2 jmc 187: (or NOT containing the last pattern,
188: if the previous search was /! or ?!).
1.1 millert 189: .It Ic N
190: Repeat previous search in the opposite direction,
1.2 jmc 191: for N-th line containing the last pattern
192: (or NOT containing the last pattern,
193: if the previous search was /! or ?!).
1.5 jmc 194: .It Ic :e Op Ar filename
1.1 millert 195: Examine a new file.
1.5 jmc 196: If the filename is missing, the "current" file (see the
197: .Ic :n
198: and
199: .Ic :p
200: commands below)
201: from the list of files in the command line is re-examined.
1.1 millert 202: If the filename is a pound sign (#), the previously examined file is
203: re-examined.
1.2 jmc 204: .It Ic :n
1.1 millert 205: Examine the next file (from the list of files given in the command line).
206: If a number N is specified (not to be confused with the command N),
207: the N-th next file is examined.
1.5 jmc 208: .It Ic :p
1.1 millert 209: Examine the previous file.
210: If a number N is specified, the N-th previous file is examined.
1.2 jmc 211: .It Ic :t
1.1 millert 212: Go to supplied tag.
213: .It Ic v
214: Invokes an editor to edit the current file being viewed.
215: The editor is taken from the environment variable
216: .Ev EDITOR ,
217: or defaults to
1.2 jmc 218: .Xr vi 1 .
1.10 ! jmc 219: .It Ic = | ^G
1.1 millert 220: These options print out the number of the file currently being displayed
221: relative to the total number of files there are to display, the current
222: line number, the current byte number and the total bytes to display, and
223: what percentage of the file has been displayed.
224: If
225: .Nm
226: is reading from the standard input,
227: or the file is shorter than a single screen, some
228: of these items may not be available.
229: Note, all of these items reference the first byte of the last line
230: displayed on the screen.
1.10 ! jmc 231: .It Ic q | :q | ZZ
1.1 millert 232: Exits
233: .Nm .
234: .El
235: .Sh ENVIRONMENT
1.4 jmc 236: .Bl -tag -width "COLUMNSXXX"
237: .It Ev COLUMNS
238: Sets the number of columns on the screen.
239: Takes precedence over the number of columns specified by the
240: .Ev TERM
241: variable,
242: but may be overridden by window systems which support
243: .Dv TIOCGWINSZ .
1.1 millert 244: .It Ev EDITOR
1.10 ! jmc 245: Specifies the default editor.
! 246: If not set,
1.1 millert 247: .Xr vi 1
248: is used.
1.4 jmc 249: .It Ev LINES
250: Sets the number of lines on the screen.
251: Takes precedence over the number of lines specified by the TERM variable,
252: but may be overridden by window systems which support
253: .Dv TIOCGWINSZ .
1.1 millert 254: .It Ev MORE
255: Default command line options to use with
256: .Nm .
257: The options should be space-separated and must be prefixed with a dash
258: .Pq Ql - .
259: .It Ev TERM
1.4 jmc 260: Specifies the terminal type.
261: Used by
262: .Nm
263: to get the terminal characteristics necessary to manipulate the screen.
1.1 millert 264: .El
1.6 jmc 265: .Sh EXIT STATUS
266: .Ex -std more
1.1 millert 267: .Sh SEE ALSO
268: .Xr ctags 1 ,
269: .Xr less 1 ,
270: .Xr vi 1
271: .Sh STANDARDS
272: The
273: .Nm
274: utility is compliant with the
275: .St -p1003.1-2008
276: specification,
277: though its presence is optional.
278: .Pp
1.7 jmc 279: Functionality allowing the user to skip (as opposed to scroll)
280: forward is not currently implemented.
1.1 millert 281: .Pp
282: Behavior for the
283: .Fl e
1.8 millert 284: flag differs between this implementation and
1.1 millert 285: .St -p1003.1-2008 .
286: .Sh HISTORY
287: A
288: .Nm
289: command appeared in
290: .Bx 3.0 .
1.2 jmc 291: .Sh AUTHORS
292: .An Mark Nudelman Aq Mt markn@greenwoodsoftware.com