1.\" $NetBSD: more.1,v 1.10 2012/06/08 12:39:42 jdf Exp $ 2.\" 3.\" Copyright (c) 1988, 1990, 1993 4.\" The Regents of the University of California. All rights reserved. 5.\" All rights reserved. 6.\" 7.\" Redistribution and use in source and binary forms, with or without 8.\" modification, are permitted provided that the following conditions 9.\" are met: 10.\" 1. Redistributions of source code must retain the above copyright 11.\" notice, this list of conditions and the following disclaimer. 12.\" 2. Redistributions in binary form must reproduce the above copyright 13.\" notice, this list of conditions and the following disclaimer in the 14.\" documentation and/or other materials provided with the distribution. 15.\" 3. Neither the name of the University nor the names of its contributors 16.\" may be used to endorse or promote products derived from this software 17.\" without specific prior written permission. 18.\" 19.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 23.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29.\" SUCH DAMAGE. 30.\" 31.\" @(#)more.1 8.2 (Berkeley) 4/18/94 32.\" 33.Dd April 18, 1994 34.Dt MORE 1 35.Os 36.Sh NAME 37.Nm more 38.Nd file perusal filter for CRT viewing 39.Sh SYNOPSIS 40.Nm 41.Op Fl ceinus 42.Op Fl t Ar tag 43.Op Fl x Ar tabs 44.Op Fl / Ar pattern 45.Op Fl # 46.Op Ar 47.Sh DESCRIPTION 48The 49.Nm 50command is a filter for paging through text one screenful at a time. 51It uses 52.Xr termcap 3 53so it can run on a variety of terminals. 54There is even limited support for hardcopy terminals. 55(On a hardcopy terminal, lines which should be printed at the top 56of the screen are prefixed with an up-arrow). 57.Ar File 58may be a single dash (``-''), implying stdin. 59.Sh OPTIONS 60Command line options are described below. 61Options are also taken from the environment variable 62.Ev MORE 63(make sure to precede them with a dash (``-'')) but command 64line options will override them. 65.Bl -tag -width flag 66.It Fl c 67Normally, 68.Nm 69will repaint the screen by scrolling from the bottom of the screen. 70If the 71.Fl c 72option is set, when 73.Nm 74needs to change the entire display, it will paint from the top line down. 75.It Fl e 76Normally, if displaying a single file, 77.Nm 78exits as soon as it reaches end-of-file. The 79.Fl e 80option tells more to 81exit if it reaches end-of-file twice without an intervening operation. 82If the file is shorter than a single screen 83.Nm 84will exit at end-of-file regardless. 85.It Fl i 86The 87.Fl i 88option causes searches to ignore case; that is, 89uppercase and lowercase are considered identical. 90.It Fl n 91The 92.Fl n 93flag suppresses line numbers. 94The default (to use line numbers) may cause 95.Nm 96to run more slowly in some cases, especially with a very large input file. 97Suppressing line numbers with the 98.Fl n 99flag will avoid this problem. 100Using line numbers means: the line number will be displayed in the 101.Cm = 102command, and the 103.Cm v 104command will pass the current line number to the editor. 105.It Fl s 106The 107.Fl s 108option causes 109consecutive blank lines to be squeezed into a single blank line. 110.It Fl t 111The 112.Fl t 113option, followed immediately by a tag, will edit the file 114containing that tag. For more information, see the 115.Xr ctags 1 116command. 117.It Fl u 118By default, 119.Nm 120treats backspaces and 121.Dv CR-LF 122sequences specially. Backspaces which appear 123adjacent to an underscore character are displayed as underlined text. 124Backspaces which appear between two identical characters are displayed 125as emboldened text. 126.Dv CR-LF 127sequences are compressed to a single linefeed 128character. The 129.Fl u 130option causes backspaces to always be displayed as 131control characters, i.e. as the two character sequence ``^H'', and 132.Dv CR-LF 133to be left alone. 134.It Fl x 135The 136.Fl x 137option sets tab stops every 138.Ar N 139positions. The default for 140.Ar N 141is 8. 142.It Fl / 143The 144.Fl / 145option specifies a string that will be searched for before 146each file is displayed. 147.El 148.Sh COMMANDS 149Interactive commands for 150.Nm 151are based on 152.Xr vi 1 . 153Some commands may be preceded by a decimal number, called N in the 154descriptions below. 155In the following descriptions, ^X means control-X. 156.Pp 157.Bl -tag -width Ic 158.It Ic h 159Help: display a summary of these commands. 160If you forget all the other commands, remember this one. 161.It Xo 162.Ic SPACE 163.No or 164.Ic f 165.No or 166.Ic \&^F 167.Xc 168Scroll forward N lines, default one window. 169If N is more than the screen size, only the final screenful is displayed. 170.It Ic b No or Ic \&^B 171Scroll backward N lines, default one window (see option -z below). 172If N is more than the screen size, only the final screenful is displayed. 173.It Ic j No or Ic RETURN 174Scroll forward N lines, default 1. 175The entire N lines are displayed, even if N is more than the screen size. 176.It Ic k 177Scroll backward N lines, default 1. 178The entire N lines are displayed, even if N is more than the screen size. 179.It Ic d No or Ic \&^D 180Scroll forward N lines, default one half of the screen size. 181If N is specified, it becomes the new default for 182subsequent d and u commands. 183.It Ic u No or Ic \&^U 184Scroll backward N lines, default one half of the screen size. 185If N is specified, it becomes the new default for 186subsequent d and u commands. 187.It Ic g 188Go to line N in the file, default 1 (beginning of file). 189.It Ic G 190Go to line N in the file, default the end of the file. 191.It Ic p No or Ic \&% 192Go to a position N percent into the file. N should be between 0 193and 100. (This works if standard input is being read, but only if 194.Nm 195has already read to the end of the file. It is always fast, but 196not always useful.) 197.It Ic r No or Ic \&^L 198Repaint the screen. 199.It Ic R 200Repaint the screen, discarding any buffered input. 201Useful if the file is changing while it is being viewed. 202.It Ic m 203Followed by any lowercase letter, 204marks the current position with that letter. 205.It Ic \&' 206(Single quote.) 207Followed by any lowercase letter, returns to the position which 208was previously marked with that letter. 209Followed by another single quote, returns to the position at 210which the last "large" movement command was executed, or the 211beginning of the file if no such movements have occurred. 212All marks are lost when a new file is examined. 213.It Ic \&/ Ns Ar pattern 214Search forward in the file for the N-th line containing the pattern. 215N defaults to 1. 216The pattern is a regular expression, as recognized by 217.Xr ed 1 . 218The search starts at the second line displayed. 219.It Ic \&? Ns Ar pattern 220Search backward in the file for the N-th line containing the pattern. 221The search starts at the line immediately before the top line displayed. 222.It Ic \&/\&! Ns Ar pattern 223Like /, but the search is for the N-th line 224which does NOT contain the pattern. 225.It Ic \&?\&! Ns Ar pattern 226Like ?, but the search is for the N-th line 227which does NOT contain the pattern. 228.It Ic n 229Repeat previous search, for N-th line containing the last pattern 230(or 231.Tn NOT 232containing the last pattern, if the previous search 233was /! or ?!). 234.It Ic E Ns Op Ar filename 235Examine a new file. 236If the filename is missing, the "current" file (see the N and P commands 237below) from the list of files in the command line is re-examined. 238If the filename is a pound sign (#), the previously examined file is 239re-examined. 240.It Ic N No or Ic \&:n 241Examine the next file (from the list of files given in the command line). 242If a number N is specified (not to be confused with the command N), 243the N-th next file is examined. 244.It Ic P No or Ic \&:p 245Examine the previous file. 246If a number N is specified, the N-th previous file is examined. 247.It Ic \&:t 248Go to supplied tag. 249.It Ic v 250Invokes an editor to edit the current file being viewed. 251The editor is taken from the environment variable 252.Ev EDITOR , 253or defaults to 254.Xr vi 1 . 255.It Ic \&= No or Ic \&^G 256These options print out the number of the file currently being displayed 257relative to the total number of files there are to display, the current 258line number, the current byte number and the total bytes to display, and 259what percentage of the file has been displayed. 260If 261.Nm 262is reading from stdin, or the file is shorter than a single screen, some 263of these items may not be available. Note, all of these items reference 264the first byte of the last line displayed on the screen. 265.It Xo 266.Ic q 267.No or 268.Ic \&:q 269.No or 270.Ic ZZ 271.Xc 272Exits 273.Nm . 274.El 275.Sh ENVIRONMENT 276The 277.Nm 278command uses the following environment variables, if they exist: 279.Bl -tag -width Fl 280.It Ev MORE 281This variable may be set with favored options to 282.Nm . 283.It Ev EDITOR 284Specify default editor. 285.It Ev SHELL 286Current shell in use (normally set by the shell at login time). 287.It Ev TERM 288Specifies terminal type, used by more to get the terminal 289characteristics necessary to manipulate the screen. 290.El 291.Sh SEE ALSO 292.Xr ctags 1 , 293.Xr vi 1 294.Sh HISTORY 295The 296.Nm 297command appeared in 298.Bx 3.0 . 299.Sh AUTHORS 300This software is derived from software contributed to Berkeley 301by Mark Nudelman. 302