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