Annotation of src/usr.bin/less/more.1, Revision 1.3
1.3 ! jmc 1: .\" $OpenBSD: more.1,v 1.2 2014/04/07 21:57:12 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.2 jmc 32: .Dd $Mdocdate: April 7 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: There is even limited support for hardcopy terminals.
52: (On a hardcopy terminal, lines which should be
53: printed at the top of the screen are prefixed with an up-arrow.)
54: If no
55: .Ar file
56: is specified, or if
57: .Ar file
58: is a single dash
59: .Pq Ql - ,
60: the standard input is used.
61: .Pp
62: The options are as follows:
63: .Bl -tag -width Ds
64: .It Fl c
1.3 ! jmc 65: When changing the display, paint from the top line down.
! 66: The default is to scroll from the bottom of the screen.
1.1 millert 67: .It Fl e
1.3 ! jmc 68: Exit on reaching end-of-file twice
! 69: without an intervening operation.
! 70: The default is to exit as soon as end-of-file is reached.
1.1 millert 71: If the file is shorter than a single screen
72: .Nm
1.3 ! jmc 73: exits at end-of-file regardless.
1.1 millert 74: .It Fl i
1.3 ! jmc 75: Ignore case.
! 76: Upper case and lower case are considered identical.
1.1 millert 77: .It Fl n Ar number
1.3 ! jmc 78: Page
1.1 millert 79: .Ar number
80: of lines per screenful.
81: By default,
82: .Nm
1.3 ! jmc 83: uses the terminal window size.
1.1 millert 84: .It Fl p Ar command
85: Execute the specified
86: .Nm
87: .Ar command
88: when the file is first opened.
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.1 millert 109: .Sh COMMANDS
110: Interactive commands for
111: .Nm
112: are based on
113: .Xr vi 1 .
114: Some commands may be preceded by a decimal number, called N in the
115: descriptions below.
116: In the following descriptions, ^X means control-X.
117: .Bl -tag -width Ic
118: .It Ic h
119: Help: display a summary of these commands.
120: If you forget all the other commands, remember this one.
121: .It Xo
122: .Ic SPACE
123: .No or
124: .Ic f
125: .No or
1.2 jmc 126: .Ic ^F
1.1 millert 127: .Xc
128: Scroll forward N lines, default one window.
129: If N is more than the screen size, only the final screenful is displayed.
1.2 jmc 130: .It Ic b No or Ic ^B
1.1 millert 131: Scroll backward N lines, default one window (see option -z below).
132: If N is more than the screen size, only the final screenful is displayed.
133: .It Ic j No or Ic RETURN
134: Scroll forward N lines, default 1.
135: The entire N lines are displayed, even if N is more than the screen size.
136: .It Ic k
137: Scroll backward N lines, default 1.
138: The entire N lines are displayed, even if N is more than the screen size.
1.2 jmc 139: .It Ic d No or Ic ^D
1.1 millert 140: Scroll forward N lines, default one half of the screen size.
141: If N is specified, it becomes the new default for
142: subsequent d and u commands.
1.2 jmc 143: .It Ic u No or Ic ^U
1.1 millert 144: Scroll backward N lines, default one half of the screen size.
145: If N is specified, it becomes the new default for
146: subsequent d and u commands.
147: .It Ic g
148: Go to line N in the file, default 1 (beginning of file).
149: .It Ic G
150: Go to line N in the file, default the end of the file.
1.2 jmc 151: .It Ic p No or Ic %
1.1 millert 152: Go to a position N percent into the file.
153: N should be between 0 and 100.
154: (This works if standard input is being read, but only if
155: .Nm
156: has already read to the end of the file.
157: It is always fast, but not always useful.)
1.2 jmc 158: .It Ic r No or Ic ^L
1.1 millert 159: Repaint the screen.
160: .It Ic R
161: Repaint the screen, discarding any buffered input.
162: Useful if the file is changing while it is being viewed.
163: .It Ic m
164: Followed by any lowercase letter,
165: marks the current position with that letter.
1.2 jmc 166: .It Ic '
1.1 millert 167: (Single quote.)
168: Followed by any lowercase letter, returns to the position which
169: was previously marked with that letter.
170: Followed by another single quote, returns to the position at
171: which the last "large" movement command was executed, or the
172: beginning of the file if no such movements have occurred.
173: All marks are lost when a new file is examined.
1.2 jmc 174: .It Ic / Ns Ar pattern
1.1 millert 175: Search forward in the file for the N-th line containing the pattern.
176: N defaults to 1.
177: The pattern is a regular expression, as recognized by
1.2 jmc 178: .Xr ed 1 .
1.1 millert 179: The search starts at the second line displayed.
1.2 jmc 180: .It Ic ?\& Ns Ar pattern
1.1 millert 181: Search backward in the file for the N-th line containing the pattern.
182: The search starts at the line immediately before the top line displayed.
1.2 jmc 183: .It Ic /! Ns Ar pattern
1.1 millert 184: Like /, but the search is for the N-th line
185: which does NOT contain the pattern.
1.2 jmc 186: .It Ic ?! Ns Ar pattern
1.1 millert 187: Like ?, but the search is for the N-th line
188: which does NOT contain the pattern.
189: .It Ic n
190: Repeat previous search, for N-th line containing the last pattern
1.2 jmc 191: (or NOT containing the last pattern,
192: if the previous search was /! or ?!).
1.1 millert 193: .It Ic N
194: Repeat previous search in the opposite direction,
1.2 jmc 195: for N-th line containing the last pattern
196: (or NOT containing the last pattern,
197: if the previous search was /! or ?!).
1.1 millert 198: .It Ic E Ns Op Ar filename
199: Examine a new file.
200: If the filename is missing, the "current" file (see the N and P commands
201: below) from the list of files in the command line is re-examined.
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.2 jmc 208: .It Ic P No or 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 .
219: .It Ic = No or 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.
231: .It Xo
232: .Ic q
233: .No or
1.2 jmc 234: .Ic :q
1.1 millert 235: .No or
236: .Ic ZZ
237: .Xc
238: Exits
239: .Nm .
240: .El
241: .Sh ENVIRONMENT
242: .Nm
243: utilizes the following environment variables, if they exist:
244: .Bl -tag -width Fl
245: .It Ev EDITOR
246: The default editor if
247: .Ev VISUAL
248: is not set.
249: If neither
250: .Ev VISUAL
251: nor
252: .Ev EDITOR
253: are set,
254: .Xr vi 1
255: is used.
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 SHELL
262: Current shell in use (normally set by the shell at login time).
263: .It Ev TERM
264: Specifies terminal type, used by more to get the terminal
265: characteristics necessary to manipulate the screen.
266: .It Ev VISUAL
267: Specify default editor.
268: .El
269: .Sh SEE ALSO
270: .Xr ctags 1 ,
271: .Xr less 1 ,
272: .Xr vi 1
273: .Sh STANDARDS
274: The
275: .Nm
276: utility is compliant with the
277: .St -p1003.1-2008
278: specification,
279: though its presence is optional.
280: .Pp
281: This version of the
282: .Nm
283: utility is actually
284: .Xr less 1
285: in disguise.
286: As such, it will also accept options documented in
287: .Xr less 1 .
288: .Pp
289: Behavior for the
290: .Fl e
291: and
292: .Fl p
293: flags differs between this implementation and
294: .St -p1003.1-2008 .
295: The
296: .Sq s
297: command also has a different meaning.
298: .Sh HISTORY
299: A
300: .Nm
301: command appeared in
302: .Bx 3.0 .
1.2 jmc 303: .Sh AUTHORS
304: .An Mark Nudelman Aq Mt markn@greenwoodsoftware.com