[BACK]Return to more.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / less

Annotation of src/usr.bin/less/more.1, Revision 1.8

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