Annotation of src/usr.bin/less/more.1, Revision 1.9
1.9 ! jmc 1: .\" $OpenBSD: more.1,v 1.8 2014/04/09 22:53:20 millert 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.5 jmc 32: .Dd $Mdocdate: April 9 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.
128: If you forget all the other commands, remember this one.
129: .It Xo
130: .Ic SPACE
131: .No or
132: .Ic f
133: .No or
1.2 jmc 134: .Ic ^F
1.1 millert 135: .Xc
136: Scroll forward N lines, default one window.
137: If N is more than the screen size, only the final screenful is displayed.
1.2 jmc 138: .It Ic b No or Ic ^B
1.1 millert 139: Scroll backward N lines, default one window (see option -z below).
140: If N is more than the screen size, only the final screenful is displayed.
141: .It Ic j No or Ic RETURN
142: Scroll forward N lines, default 1.
143: The entire N lines are displayed, even if N is more than the screen size.
144: .It Ic k
145: Scroll backward N lines, default 1.
146: The entire N lines are displayed, even if N is more than the screen size.
1.2 jmc 147: .It Ic d No or Ic ^D
1.1 millert 148: Scroll forward N lines, default one half of the screen size.
149: If N is specified, it becomes the new default for
150: subsequent d and u commands.
1.2 jmc 151: .It Ic u No or Ic ^U
1.1 millert 152: Scroll backward N lines, default one half of the screen size.
153: If N is specified, it becomes the new default for
154: subsequent d and u commands.
155: .It Ic g
156: Go to line N in the file, default 1 (beginning of file).
157: .It Ic G
158: Go to line N in the file, default the end of the file.
1.2 jmc 159: .It Ic r No or Ic ^L
1.1 millert 160: Repaint the screen.
161: .It Ic R
162: Repaint the screen, discarding any buffered input.
163: Useful if the file is changing while it is being viewed.
164: .It Ic m
165: Followed by any lowercase letter,
166: marks the current position with that letter.
1.2 jmc 167: .It Ic '
1.1 millert 168: (Single quote.)
169: Followed by any lowercase letter, returns to the position which
170: was previously marked with that letter.
171: Followed by another single quote, returns to the position at
172: which the last "large" movement command was executed, or the
173: beginning of the file if no such movements have occurred.
174: All marks are lost when a new file is examined.
1.2 jmc 175: .It Ic / Ns Ar pattern
1.1 millert 176: Search forward in the file for the N-th line containing the pattern.
177: N defaults to 1.
178: The pattern is a regular expression, as recognized by
1.2 jmc 179: .Xr ed 1 .
1.1 millert 180: The search starts at the second line displayed.
1.2 jmc 181: .It Ic ?\& Ns Ar pattern
1.1 millert 182: Search backward in the file for the N-th line containing the pattern.
183: The search starts at the line immediately before the top line displayed.
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.
1.2 jmc 187: .It Ic ?! Ns Ar pattern
1.1 millert 188: Like ?, but the search is for the N-th line
189: which does NOT contain the pattern.
190: .It Ic n
191: Repeat previous search, for N-th line containing the last pattern
1.2 jmc 192: (or NOT containing the last pattern,
193: if the previous search was /! or ?!).
1.1 millert 194: .It Ic N
195: Repeat previous search in the opposite direction,
1.2 jmc 196: for N-th line containing the last pattern
197: (or NOT containing the last pattern,
198: if the previous search was /! or ?!).
1.5 jmc 199: .It Ic :e Op Ar filename
1.1 millert 200: Examine a new file.
1.5 jmc 201: If the filename is missing, the "current" file (see the
202: .Ic :n
203: and
204: .Ic :p
205: commands below)
206: from the list of files in the command line is re-examined.
1.1 millert 207: If the filename is a pound sign (#), the previously examined file is
208: re-examined.
1.2 jmc 209: .It Ic :n
1.1 millert 210: Examine the next file (from the list of files given in the command line).
211: If a number N is specified (not to be confused with the command N),
212: the N-th next file is examined.
1.5 jmc 213: .It Ic :p
1.1 millert 214: Examine the previous file.
215: If a number N is specified, the N-th previous file is examined.
1.2 jmc 216: .It Ic :t
1.1 millert 217: Go to supplied tag.
218: .It Ic v
219: Invokes an editor to edit the current file being viewed.
220: The editor is taken from the environment variable
221: .Ev EDITOR ,
222: or defaults to
1.2 jmc 223: .Xr vi 1 .
224: .It Ic = No or Ic ^G
1.1 millert 225: These options print out the number of the file currently being displayed
226: relative to the total number of files there are to display, the current
227: line number, the current byte number and the total bytes to display, and
228: what percentage of the file has been displayed.
229: If
230: .Nm
231: is reading from the standard input,
232: or the file is shorter than a single screen, some
233: of these items may not be available.
234: Note, all of these items reference the first byte of the last line
235: displayed on the screen.
236: .It Xo
237: .Ic q
238: .No or
1.2 jmc 239: .Ic :q
1.1 millert 240: .No or
241: .Ic ZZ
242: .Xc
243: Exits
244: .Nm .
245: .El
246: .Sh ENVIRONMENT
1.4 jmc 247: .Bl -tag -width "COLUMNSXXX"
248: .It Ev COLUMNS
249: Sets the number of columns on the screen.
250: Takes precedence over the number of columns specified by the
251: .Ev TERM
252: variable,
253: but may be overridden by window systems which support
254: .Dv TIOCGWINSZ .
1.1 millert 255: .It Ev EDITOR
1.4 jmc 256: Specifies the default editor if
1.1 millert 257: .Ev VISUAL
258: is not set.
259: If neither
260: .Ev VISUAL
261: nor
262: .Ev EDITOR
263: are set,
264: .Xr vi 1
265: is used.
1.4 jmc 266: .It Ev LINES
267: Sets the number of lines on the screen.
268: Takes precedence over the number of lines specified by the TERM variable,
269: but may be overridden by window systems which support
270: .Dv TIOCGWINSZ .
1.1 millert 271: .It Ev MORE
272: Default command line options to use with
273: .Nm .
274: The options should be space-separated and must be prefixed with a dash
275: .Pq Ql - .
276: .It Ev TERM
1.4 jmc 277: Specifies the terminal type.
278: Used by
279: .Nm
280: to get the terminal characteristics necessary to manipulate the screen.
1.1 millert 281: .It Ev VISUAL
1.4 jmc 282: Specifies the default editor.
1.1 millert 283: .El
1.6 jmc 284: .Sh EXIT STATUS
285: .Ex -std more
1.1 millert 286: .Sh SEE ALSO
287: .Xr ctags 1 ,
288: .Xr less 1 ,
289: .Xr vi 1
290: .Sh STANDARDS
291: The
292: .Nm
293: utility is compliant with the
294: .St -p1003.1-2008
295: specification,
296: though its presence is optional.
297: .Pp
1.7 jmc 298: Functionality allowing the user to skip (as opposed to scroll)
299: forward is not currently implemented.
1.1 millert 300: .Pp
301: Behavior for the
302: .Fl e
1.8 millert 303: flag differs between this implementation and
1.1 millert 304: .St -p1003.1-2008 .
305: .Sh HISTORY
306: A
307: .Nm
308: command appeared in
309: .Bx 3.0 .
1.2 jmc 310: .Sh AUTHORS
311: .An Mark Nudelman Aq Mt markn@greenwoodsoftware.com