off by one error in limit for general sockaddr.
[unix-history] / usr / src / usr.bin / more / more.1
CommitLineData
bfe13c81
KB
1.\"
2.\" Copyright (c) 1988 Mark Nudleman
3.\" Copyright (c) 1988 Regents of the University of California.
4.\" All rights reserved.
5.\"
bfe13c81
KB
6.\" Redistribution and use in source and binary forms are permitted
7.\" provided that the above copyright notice and this paragraph are
8.\" duplicated in all such forms and that any documentation,
9.\" advertising materials, and other materials related to such
10.\" distribution and use acknowledge that the software was developed
a942b40b
KB
11.\" by Mark Nudleman and the University of California, Berkeley. The
12.\" name of Mark Nudleman or the
bfe13c81
KB
13.\" University may not be used to endorse or promote products derived
14.\" from this software without specific prior written permission.
15.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
16.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
17.\" WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18.\"
00f91e6d 19.\" @(#)more.1 5.11 (Berkeley) %G%
bfe13c81 20.\"
410c1f41 21.TH MORE 1
bfe13c81 22.SH NAME
410c1f41 23more \- file perusal filter for crt viewing
bfe13c81 24.SH SYNOPSIS
098ce2dc 25.B "more [-ceinus] [-t tag] [-x tabs] [-/ pattern] [-#] [file ...]"
bfe13c81 26.SH DESCRIPTION
410c1f41
KB
27.I More
28is a filter for paging through text one screenful at a time. It
29uses
30.IR termcap (3)
31so it can run on a variety of terminals. There is even limited support
32for hardcopy terminals. (On a hardcopy terminal, lines which should be
33printed at the top of the screen are prefixed with an up-arrow.)
34.I File
35may be a single dash (``-''), implying stdin.
36.SH OPTIONS
37Command line options are described below.
38Options are also taken from the environment variable "MORE"
39(make sure to precede them with a dash (``-'')) but command
40line options will override them.
41.IP -c
42Normally,
bfe13c81 43.I more
410c1f41
KB
44will repaint the screen by scrolling from the bottom of the screen.
45If the -c option is set, when
46.I more
47needs to change the entire display, it will paint from the top line down.
48.IP -e
00f91e6d 49Normally, if displaying a single file,
bfe13c81 50.I more
410c1f41 51exits as soon as it reaches end-of-file. The -e option tells more to
00f91e6d
KB
52exit if it reaches end-of-file twice without an intervening operation.
53If the file is shorter than a single screen
54.I more
55will exit at end-of-file regardless.
410c1f41
KB
56.IP -i
57The -i option causes searches to ignore case; that is,
58uppercase and lowercase are considered identical.
59.IP -n
60The -n flag suppresses line numbers.
61The default (to use line numbers) may cause
62.I more
63to run more slowly in some cases, especially with a very large input file.
64Suppressing line numbers with the -n flag will avoid this problem.
65Using line numbers means: the line number will be displayed in the
66= command, and the v command will pass the current line number to the editor.
410c1f41
KB
67.IP -s
68The -s option causes
69consecutive blank lines to be squeezed into a single blank line.
70.IP -t
71The -t option, followed immediately by a tag, will edit the file
72containing that tag. For more information, see the
73.IR ctags (1)
74command.
75.IP -u
dacf700d
KB
76By default,
77.I more
78treats backspaces and CR-LF sequences specially. Backspaces which appear
79adjacent to an underscore character are displayed as underlined text.
80Backspaces which appear between two identical characters are displayed
81as emboldened text. CR-LF sequences are compressed to a single linefeed
82character. The -u option causes backspaces to always be displayed as
83control characters, i.e. as the two character sequence ``^H'', and CR-LF
84to be left alone.
410c1f41
KB
85.IP -x
86The -x option sets tab stops every
87.I N
88positions. The default for
89.I N
90is 8.
91.IP -/
92The -/ option specifies a string that will be searched for before
93each file is displayed.
bfe13c81 94.SH COMMANDS
410c1f41
KB
95Interactive commands for
96.I more
97are based on
98.IR vi (1).
99Some commands may be preceeded by a decimal number, called N in the
100descriptions below.
bfe13c81 101In the following descriptions, ^X means control-X.
410c1f41
KB
102.IP h
103help: display a summary of these commands.
bfe13c81
KB
104If you forget all the other commands, remember this one.
105.PP
410c1f41
KB
106.IP "SPACE or f or ^F"
107Scroll forward N lines, default one window.
bfe13c81 108If N is more than the screen size, only the final screenful is displayed.
bfe13c81 109.PP
410c1f41 110.IP "b or ^B"
bfe13c81
KB
111Scroll backward N lines, default one window (see option -z below).
112If N is more than the screen size, only the final screenful is displayed.
113.PP
410c1f41 114.IP "j or RETURN"
bfe13c81
KB
115Scroll forward N lines, default 1.
116The entire N lines are displayed, even if N is more than the screen size.
117.PP
410c1f41 118.IP "k"
bfe13c81
KB
119Scroll backward N lines, default 1.
120The entire N lines are displayed, even if N is more than the screen size.
bfe13c81
KB
121.PP
122.IP "d or ^D"
123Scroll forward N lines, default one half of the screen size.
124If N is specified, it becomes the new default for
125subsequent d and u commands.
126.PP
127.IP "u or ^U"
128Scroll backward N lines, default one half of the screen size.
129If N is specified, it becomes the new default for
130subsequent d and u commands.
131.PP
410c1f41 132.IP "g"
bfe13c81 133Go to line N in the file, default 1 (beginning of file).
bfe13c81 134.PP
410c1f41 135.IP "G"
bfe13c81 136Go to line N in the file, default the end of the file.
bfe13c81
KB
137.PP
138.IP "p or %"
410c1f41
KB
139Go to a position N percent into the file. N should be between 0
140and 100. (This works if standard input is being read, but only if
141.I more
142has already read to the end of the file. It is always fast, but
143not always useful.)
144.PP
145.IP "r or ^L"
146Repaint the screen.
147.PP
148.IP "R"
149Repaint the screen, discarding any buffered input.
150Useful if the file is changing while it is being viewed.
bfe13c81
KB
151.PP
152.IP m
153Followed by any lowercase letter,
154marks the current position with that letter.
155.PP
156.IP "'"
157(Single quote.)
158Followed by any lowercase letter, returns to the position which
159was previously marked with that letter.
160Followed by another single quote, returns to the postion at
148d5db7
KB
161which the last "large" movement command was executed, or the
162beginning of the file if no such movements have occurred.
bfe13c81
KB
163All marks are lost when a new file is examined.
164.PP
bfe13c81
KB
165.IP /pattern
166Search forward in the file for the N-th line containing the pattern.
167N defaults to 1.
168The pattern is a regular expression, as recognized by
169.I ed.
410c1f41 170The search starts at the second line displayed.
bfe13c81
KB
171.PP
172.IP ?pattern
173Search backward in the file for the N-th line containing the pattern.
174The search starts at the line immediately before the top line displayed.
175.PP
176.IP /!pattern
177Like /, but the search is for the N-th line
178which does NOT contain the pattern.
179.PP
180.IP ?!pattern
181Like ?, but the search is for the N-th line
182which does NOT contain the pattern.
183.PP
184.IP n
185Repeat previous search, for N-th line containing the last pattern
186(or NOT containing the last pattern, if the previous search
187was /! or ?!).
188.PP
189.IP "E [filename]"
190Examine a new file.
191If the filename is missing, the "current" file (see the N and P commands
192below) from the list of files in the command line is re-examined.
193If the filename is a pound sign (#), the previously examined file is
194re-examined.
195.PP
bfe13c81
KB
196.IP "N or :n"
197Examine the next file (from the list of files given in the command line).
198If a number N is specified (not to be confused with the command N),
199the N-th next file is examined.
200.PP
201.IP "P or :p"
202Examine the previous file.
203If a number N is specified, the N-th previous file is examined.
204.PP
410c1f41
KB
205.IP ":t"
206Go to supplied tag.
bfe13c81 207.PP
bfe13c81
KB
208.IP v
209Invokes an editor to edit the current file being viewed.
210The editor is taken from the environment variable EDITOR,
410c1f41
KB
211or defaults to
212.IR vi (1).
bfe13c81 213.PP
410c1f41
KB
214.IP "= or ^G"
215These options print out the number of the file currently being displayed
6d713a99
KB
216relative to the total number of files there are to display, the current
217line number, the current byte number and the total bytes to display, and
218what percentage of the file has been displayed. If
219.I more
220is reading from stdin, or the file is shorter than a single screen, some
221of these items may not be available. Note, all of these items reference
222the first byte of the last line displayed on the screen.
bfe13c81 223.PP
410c1f41
KB
224.IP "q or :q or ZZ"
225Exits
bfe13c81 226.I more.
410c1f41
KB
227.SH "SEE ALSO
228ctags(1), vi(1)
a942b40b 229.SH AUTHOR
410c1f41
KB
230This software is derived from software contributed to Berkeley
231by Mark Nudleman.