Commit | Line | Data |
---|---|---|
b5dc1377 | 1 | .\" Copyright (c) 1988, 1990 The Regents of the University of California. |
bfe13c81 | 2 | .\" Copyright (c) 1988 Mark Nudleman |
bfe13c81 KB |
3 | .\" All rights reserved. |
4 | .\" | |
b5dc1377 | 5 | .\" %sccs.include.redist.man% |
bfe13c81 | 6 | .\" |
d0719240 | 7 | .\" @(#)more.1 5.14 (Berkeley) %G% |
bfe13c81 | 8 | .\" |
b5dc1377 CL |
9 | .Dd |
10 | .Dt MORE 1 | |
11 | .Sh NAME | |
12 | .Nm more | |
13 | .Nd file perusal filter for crt viewing | |
14 | .Sh SYNOPSIS | |
15 | .Nm more | |
16 | .Op Fl ceinus | |
17 | .Op Fl t Ar tag | |
18 | .Op Fl x Ar tabs | |
19 | .Op Fl / Ar pattern | |
20 | .Op Fl # | |
21 | .Ar | |
22 | .Sh DESCRIPTION | |
23 | .Nm More | |
410c1f41 KB |
24 | is a filter for paging through text one screenful at a time. It |
25 | uses | |
b5dc1377 | 26 | .Xr termcap 3 |
410c1f41 KB |
27 | so it can run on a variety of terminals. There is even limited support |
28 | for hardcopy terminals. (On a hardcopy terminal, lines which should be | |
29 | printed at the top of the screen are prefixed with an up-arrow.) | |
b5dc1377 | 30 | .Ar File |
410c1f41 | 31 | may be a single dash (``-''), implying stdin. |
b5dc1377 | 32 | .Sh OPTIONS |
410c1f41 | 33 | Command line options are described below. |
b5dc1377 CL |
34 | Options are also taken from the environment variable |
35 | .Ev MORE | |
410c1f41 KB |
36 | (make sure to precede them with a dash (``-'')) but command |
37 | line options will override them. | |
b5dc1377 CL |
38 | .Tw Fl |
39 | .Tp Fl c | |
40 | Normally, | |
41 | .Nm more | |
410c1f41 | 42 | will repaint the screen by scrolling from the bottom of the screen. |
b5dc1377 CL |
43 | If the |
44 | .Fl c | |
45 | option is set, when | |
46 | .Nm more | |
410c1f41 | 47 | needs to change the entire display, it will paint from the top line down. |
b5dc1377 | 48 | .Tp Fl e |
00f91e6d | 49 | Normally, if displaying a single file, |
b5dc1377 CL |
50 | .Nm more |
51 | exits as soon as it reaches end-of-file. The | |
52 | .Fl e | |
53 | option tells more to | |
00f91e6d KB |
54 | exit if it reaches end-of-file twice without an intervening operation. |
55 | If the file is shorter than a single screen | |
b5dc1377 | 56 | .Nm more |
00f91e6d | 57 | will exit at end-of-file regardless. |
b5dc1377 CL |
58 | .Tp Fl i |
59 | The | |
60 | .Fl i | |
61 | option causes searches to ignore case; that is, | |
410c1f41 | 62 | uppercase and lowercase are considered identical. |
b5dc1377 CL |
63 | .Tp Fl n |
64 | The | |
65 | .Fl n | |
66 | flag suppresses line numbers. | |
410c1f41 | 67 | The default (to use line numbers) may cause |
b5dc1377 | 68 | .Nm more |
410c1f41 | 69 | to run more slowly in some cases, especially with a very large input file. |
b5dc1377 CL |
70 | Suppressing line numbers with the |
71 | .Fl n | |
72 | flag will avoid this problem. | |
73 | Using line numbers means: the line number will be displayed in the | |
5325ced3 CL |
74 | .Cm = |
75 | command, and the | |
76 | .Cm v | |
77 | command will pass the current line number to the editor. | |
b5dc1377 CL |
78 | .Tp Fl s |
79 | The | |
80 | .Fl s | |
81 | option causes | |
410c1f41 | 82 | consecutive blank lines to be squeezed into a single blank line. |
b5dc1377 CL |
83 | .Tp Fl t |
84 | The | |
85 | .Fl t | |
86 | option, followed immediately by a tag, will edit the file | |
410c1f41 | 87 | containing that tag. For more information, see the |
b5dc1377 | 88 | .Xr ctags 1 |
410c1f41 | 89 | command. |
b5dc1377 | 90 | .Tp Fl u |
dacf700d | 91 | By default, |
b5dc1377 | 92 | .Nm more |
dacf700d KB |
93 | treats backspaces and CR-LF sequences specially. Backspaces which appear |
94 | adjacent to an underscore character are displayed as underlined text. | |
95 | Backspaces which appear between two identical characters are displayed | |
96 | as emboldened text. CR-LF sequences are compressed to a single linefeed | |
b5dc1377 CL |
97 | character. The |
98 | .Fl u | |
99 | option causes backspaces to always be displayed as | |
dacf700d KB |
100 | control characters, i.e. as the two character sequence ``^H'', and CR-LF |
101 | to be left alone. | |
b5dc1377 CL |
102 | .Tp Fl x |
103 | The | |
104 | .Fl x | |
105 | option sets tab stops every | |
106 | .Ar N | |
410c1f41 | 107 | positions. The default for |
b5dc1377 | 108 | .Ar N |
410c1f41 | 109 | is 8. |
b5dc1377 CL |
110 | .Tp Fl \&/ |
111 | The | |
112 | .Fl \&/ | |
113 | option specifies a string that will be searched for before | |
410c1f41 | 114 | each file is displayed. |
b5dc1377 | 115 | .Sh COMMANDS |
410c1f41 | 116 | Interactive commands for |
b5dc1377 | 117 | .Nm more |
410c1f41 | 118 | are based on |
b5dc1377 | 119 | .Xr vi 1 . |
410c1f41 KB |
120 | Some commands may be preceeded by a decimal number, called N in the |
121 | descriptions below. | |
bfe13c81 | 122 | In the following descriptions, ^X means control-X. |
b5dc1377 CL |
123 | .Pp |
124 | .Tw Ic | |
125 | .Tp Ic h | |
410c1f41 | 126 | help: display a summary of these commands. |
bfe13c81 | 127 | If you forget all the other commands, remember this one. |
b5dc1377 CL |
128 | .Tp Cx Ic SPACE |
129 | .Ws | |
130 | .Cx or | |
131 | .Ws | |
132 | .Ic f | |
133 | .Ws | |
134 | .Cx or | |
135 | .Ws | |
136 | .Ic \&^F | |
137 | .Cx | |
410c1f41 | 138 | Scroll forward N lines, default one window. |
bfe13c81 | 139 | If N is more than the screen size, only the final screenful is displayed. |
b5dc1377 CL |
140 | .Tp Cx Ic b |
141 | .Ws | |
142 | .Cx or | |
143 | .Ws | |
144 | .Ic \&^B | |
145 | .Cx | |
bfe13c81 KB |
146 | Scroll backward N lines, default one window (see option -z below). |
147 | If N is more than the screen size, only the final screenful is displayed. | |
b5dc1377 CL |
148 | .Tp Cx Ic j |
149 | .Ws | |
150 | .Cx or | |
151 | .Ws | |
152 | .Ic RETURN | |
153 | .Cx | |
bfe13c81 KB |
154 | Scroll forward N lines, default 1. |
155 | The entire N lines are displayed, even if N is more than the screen size. | |
b5dc1377 | 156 | .Tp Ic k |
bfe13c81 KB |
157 | Scroll backward N lines, default 1. |
158 | The entire N lines are displayed, even if N is more than the screen size. | |
5325ced3 | 159 | .Tp Cx Ic d |
b5dc1377 CL |
160 | .Ws |
161 | .Cx or | |
162 | .Ws | |
163 | .Ic \&^D | |
164 | .Cx | |
bfe13c81 | 165 | Scroll forward N lines, default one half of the screen size. |
b5dc1377 | 166 | If N is specified, it becomes the new default for |
bfe13c81 | 167 | subsequent d and u commands. |
5325ced3 | 168 | .Tp Cx Ic u |
b5dc1377 CL |
169 | .Ws |
170 | .Cx or | |
171 | .Ws | |
172 | .Ic \&^U | |
173 | .Cx | |
bfe13c81 | 174 | Scroll backward N lines, default one half of the screen size. |
b5dc1377 | 175 | If N is specified, it becomes the new default for |
bfe13c81 | 176 | subsequent d and u commands. |
b5dc1377 | 177 | .Tp Ic g |
bfe13c81 | 178 | Go to line N in the file, default 1 (beginning of file). |
b5dc1377 | 179 | .Tp Ic G |
bfe13c81 | 180 | Go to line N in the file, default the end of the file. |
5325ced3 | 181 | .Tp Cx Ic p |
b5dc1377 CL |
182 | .Ws |
183 | .Cx or | |
184 | .Ws | |
185 | .Ic \&% | |
186 | .Cx | |
410c1f41 KB |
187 | Go to a position N percent into the file. N should be between 0 |
188 | and 100. (This works if standard input is being read, but only if | |
b5dc1377 | 189 | .Nm more |
410c1f41 KB |
190 | has already read to the end of the file. It is always fast, but |
191 | not always useful.) | |
5325ced3 | 192 | .Tp Cx Ic r |
b5dc1377 CL |
193 | .Ws |
194 | .Cx or | |
195 | .Ws | |
196 | .Ic \&^L | |
197 | .Cx | |
410c1f41 | 198 | Repaint the screen. |
b5dc1377 | 199 | .Tp Ic R |
410c1f41 KB |
200 | Repaint the screen, discarding any buffered input. |
201 | Useful if the file is changing while it is being viewed. | |
b5dc1377 CL |
202 | .Tp Ic m |
203 | Followed by any lowercase letter, | |
bfe13c81 | 204 | marks the current position with that letter. |
b5dc1377 | 205 | .Tp Ic \&\' |
bfe13c81 KB |
206 | (Single quote.) |
207 | Followed by any lowercase letter, returns to the position which | |
208 | was previously marked with that letter. | |
209 | Followed by another single quote, returns to the postion at | |
148d5db7 KB |
210 | which the last "large" movement command was executed, or the |
211 | beginning of the file if no such movements have occurred. | |
bfe13c81 | 212 | All marks are lost when a new file is examined. |
b5dc1377 CL |
213 | .Tp Cx Ic \&/ |
214 | .Ar pattern | |
215 | .Cx | |
bfe13c81 KB |
216 | Search forward in the file for the N-th line containing the pattern. |
217 | N defaults to 1. | |
218 | The pattern is a regular expression, as recognized by | |
b5dc1377 | 219 | .Xr ed . |
410c1f41 | 220 | The search starts at the second line displayed. |
5325ced3 | 221 | .Tp Cx Ic \&\? |
b5dc1377 CL |
222 | .Ar pattern |
223 | .Cx | |
bfe13c81 KB |
224 | Search backward in the file for the N-th line containing the pattern. |
225 | The search starts at the line immediately before the top line displayed. | |
5325ced3 | 226 | .Tp Cx Ic \&/\&! |
b5dc1377 CL |
227 | .Ar pattern |
228 | .Cx | |
bfe13c81 KB |
229 | Like /, but the search is for the N-th line |
230 | which does NOT contain the pattern. | |
5325ced3 | 231 | .Tp Cx Ic \&?\&! |
b5dc1377 CL |
232 | .Ar pattern |
233 | .Cx | |
bfe13c81 KB |
234 | Like ?, but the search is for the N-th line |
235 | which does NOT contain the pattern. | |
b5dc1377 | 236 | .Tp Ic n |
bfe13c81 KB |
237 | Repeat previous search, for N-th line containing the last pattern |
238 | (or NOT containing the last pattern, if the previous search | |
239 | was /! or ?!). | |
b5dc1377 CL |
240 | .Tp Cx Ic E |
241 | .Ws | |
242 | .Op Ar filename | |
243 | .Cx | |
bfe13c81 KB |
244 | Examine a new file. |
245 | If the filename is missing, the "current" file (see the N and P commands | |
246 | below) from the list of files in the command line is re-examined. | |
247 | If the filename is a pound sign (#), the previously examined file is | |
248 | re-examined. | |
b5dc1377 CL |
249 | .Tp Cx Ic N |
250 | .Ws | |
251 | .Cx or | |
252 | .Ws | |
253 | .Ic \&:n | |
254 | .Cx | |
bfe13c81 KB |
255 | Examine the next file (from the list of files given in the command line). |
256 | If a number N is specified (not to be confused with the command N), | |
257 | the N-th next file is examined. | |
b5dc1377 CL |
258 | .Tp Cx Ic P |
259 | .Ws | |
260 | .Cx or | |
261 | .Ws | |
262 | .Ic \&:p | |
263 | .Cx | |
bfe13c81 KB |
264 | Examine the previous file. |
265 | If a number N is specified, the N-th previous file is examined. | |
b5dc1377 | 266 | .Tp Ic \&:t |
410c1f41 | 267 | Go to supplied tag. |
b5dc1377 | 268 | .Tp Ic v |
bfe13c81 | 269 | Invokes an editor to edit the current file being viewed. |
b5dc1377 CL |
270 | The editor is taken from the environment variable |
271 | .Ev EDITOR , | |
410c1f41 | 272 | or defaults to |
b5dc1377 CL |
273 | .Xr vi 1 . |
274 | .Tp Cx Ic \&= | |
275 | .Ws | |
276 | .Cx or | |
277 | .Ws | |
278 | .Ic \&^G | |
279 | .Cx | |
410c1f41 | 280 | These options print out the number of the file currently being displayed |
6d713a99 KB |
281 | relative to the total number of files there are to display, the current |
282 | line number, the current byte number and the total bytes to display, and | |
283 | what percentage of the file has been displayed. If | |
b5dc1377 | 284 | .Nm more |
6d713a99 KB |
285 | is reading from stdin, or the file is shorter than a single screen, some |
286 | of these items may not be available. Note, all of these items reference | |
287 | the first byte of the last line displayed on the screen. | |
b5dc1377 CL |
288 | .Tp Cx Ic q |
289 | .Ws | |
290 | .Cx or | |
291 | .Ws | |
292 | .Ic \&:q | |
293 | .Ws | |
294 | .Cx or | |
295 | .Ws | |
296 | .Ic ZZ | |
297 | .Cx | |
410c1f41 | 298 | Exits |
b5dc1377 CL |
299 | .Nm more . |
300 | .Tp | |
301 | .Sh ENVIRONMENT | |
302 | .Nm More | |
5325ced3 CL |
303 | utilizes the following environment variables, if they exist: |
304 | .Tw Fl | |
305 | .Tp Ev MORE | |
306 | This variable may be set with favored options to | |
307 | .Nm more . | |
308 | .Tp Ev EDITOR | |
309 | Specify default editor. | |
310 | .Tp Ev SHELL | |
311 | Current shell in use (normally set by the shell at login time). | |
312 | .Tp Ev TERM | |
313 | Specifies terminal type, used by more to get the terminal | |
314 | characteristics necessary to manipulate the screen. | |
315 | .Tp | |
b5dc1377 CL |
316 | .Sh SEE ALSO |
317 | .Xr ctags 1 , | |
318 | .Xr vi 1 | |
319 | .Sh AUTHOR | |
410c1f41 KB |
320 | This software is derived from software contributed to Berkeley |
321 | by Mark Nudleman. | |
b5dc1377 CL |
322 | .Sh HISTORY |
323 | .Nm more | |
324 | appeared in 3 BSD. |