|
|
1.1 root 1: .TH LESS l
2: .SH NAME
3: less \- opposite of more
4: .SH SYNOPSIS
5: .B "less [-cdepstwmMqQuU] [-h\fIn\fB] [-b[fp]\fIn\fB] [-x\fIn\fB] [+\fIcmd\fB] [\fIname\fB] ..."
6: .SH DESCRIPTION
7: .I Less
8: is a program similar to
9: .I more
10: (1), but which allows backwards movement
11: in the file as well as forward movement.
12: Also,
13: .I less
14: does not have to read the entire input file before starting,
15: so with large input files it starts up faster than text editors like
16: .I vi
17: (1).
18: .I Less
19: uses termcap, so it can run on a variety of terminals.
20: There is even limited support for hardcopy terminals.
21: (On a hardcopy terminal, lines which should be printed at the top
22: of the screen are prefixed with an up-arrow.)
23: .PP
24: Commands are based on both
25: .I more
26: and
27: .I vi.
28: Commands may be preceeded by a decimal number,
29: called N in the descriptions below.
30: The number is used by some commands, as indicated.
31:
32: .SH COMMANDS
33: .IP h
34: Help: display a summary of these commands.
35: If you forget all the other commands, remember this one.
36: .PP
37: .IP SPACE
38: Scroll forward N lines, default one screen.
39: If N is more than the screen size, only one screenful is displayed.
40: .PP
41: .IP f
42: Same as SPACE.
43: .PP
44: .IP b
45: Scroll backward N lines, default one screen.
46: If N is more than the screen size, only one screenful is displayed.
47: .PP
48: .IP RETURN
49: Scroll forward N lines, default 1.
50: If N is more than the screen size, the entire N lines are displayed.
51: .PP
52: .IP e
53: Same as RETURN.
54: .PP
55: .IP j
56: Also the same as RETURN.
57: .PP
58: .IP y
59: Scroll backward N lines, default 1.
60: If N is more than the screen size, the entire N lines are displayed.
61: .IP k
62: Same as y.
63: .PP
64: .IP d
65: Scroll forward N lines, default 10.
66: If N is specified, it becomes the new default for all d and u commands.
67: .PP
68: .IP u
69: Scroll backward N lines, default 10.
70: If N is specified, it becomes the new default for all d and u commands.
71: .PP
72: .IP r
73: Repaint the screen.
74: .PP
75: .IP R
76: Repaint the screen, discarding any buffered input.
77: Useful if the file is changing while it is being viewed.
78: .PP
79: .IP g
80: Go to line N in the file, default 1 (beginning of file).
81: (Warning: this may be slow if N is large.)
82: .PP
83: .IP G
84: Go to line N in the file, default the end of the file.
85: (Warning: this may be slow if standard input,
86: rather than a file, is being read.)
87: .PP
88: .IP p
89: Go to a position N percent into the file.
90: N should be between 0 and 100.
91: (This is possible if standard input is being read,
92: but only if
93: .I less
94: has already read to the end of the file.
95: It is always fast, but not always useful.)
96: .PP
97: .IP %
98: Same as p.
99: .PP
100: .IP m
101: Followed by any lowercase letter, marks the current position with that letter.
102: .PP
103: .IP "'"
104: Followed by any lowercase letter, returns to the position which
105: was previously marked with that letter.
106: All marks are lost when a new file is examined.
107: .PP
108: .IP /pattern
109: Search forward in the file for the N-th occurence of the pattern.
110: N defaults to 1.
111: The pattern is a regular expression, as recognized by
112: .I ed.
113: The search starts at the second line displayed
114: (but see the -t option, which changes this).
115: .PP
116: .IP ?pattern
117: Search backward in the file for the N-th occurence of the pattern.
118: The search starts at the line immediately before the top line displayed.
119: .PP
120: .IP n
121: Repeat previous search, for N-th occurence of the last pattern.
122: .PP
123: .IP E [filename]
124: Examine a new file.
125: If the filename is missing, the "current" file (see the N and P commands
126: below) from the list of files in the command line is re-examined.
127: .PP
128: .IP N
129: Examine the next file (from the list of files given in the command line).
130: If a number N is specified (not to be confused with the command N),
131: the N-th next file is examined.
132: .PP
133: .IP P
134: Examine the previous file.
135: If a number N is specified, the N-th previous file is examined.
136: .PP
137: .IP =
138: Prints the name of the file being viewed
139: and the byte offset of the bottom line being displayed.
140: If possible, it also prints the length of the file
141: and the percent of the file above the last displayed line.
142: .PP
143: .IP \-
144: Followed by one of the command line option letters (see below),
145: this will toggle the setting of that option
146: and print a message describing the new setting.
147: .PP
148: .IP V
149: Prints the version number of
150: .I less
151: being run.
152: .PP
153: .IP q
154: Exits
155: .I less.
156: .PP
157: The following
158: two
159: commands may or may not be valid, depending on your particular installation.
160: .PP
161: .IP v
162: Invokes an editor to edit the current file being viewed.
163: The editor is taken from the environment variable EDITOR,
164: or defaults to "vi".
165: .PP
166: .IP "! shell-command"
167: Invokes a shell to run the shell-command given.
168: .PP
169: .SH OPTIONS
170: Command line options are described below.
171: Options are also taken from the environment variable "LESS".
172: (The environment variable is parsed before the command line,
173: so command line options override the LESS environment variable.
174: Options may be changed while
175: .I less
176: is running via the "\-" command.)
177: For example, if you like
178: more-style prompting, to avoid typing "less -m ..." each time
179: .I less
180: is invoked, you might tell
181: .I csh:
182: .sp
183: setenv LESS m
184: .sp
185: or if you use
186: .I sh:
187: .sp
188: LESS=m; export LESS
189: .IP -s
190: The -s flag causes
191: consecutive blank lines to be squeezed into a single blank line.
192: This is useful when viewing
193: .I nroff
194: output.
195: .IP -t
196: Normally, forward searches start just after
197: the top displayed line (that is, at the second displayed line).
198: Thus forward searches include the currently displayed screen.
199: The -t command line option causes forward searches to start
200: just after the bottom line displayed,
201: thus skipping the currently displayed screen.
202: .IP -m
203: Normally,
204: .I less
205: prompts with a colon.
206: The -m command line option causes
207: .I less
208: to prompt verbosely like
209: .I more,
210: printing the file name and percent into the file.
211: .IP -M
212: The -M command line option causes
213: .I less
214: to prompt even more verbosely than
215: .I more.
216: .IP -q
217: Normally, if an attempt is made to scroll past the end of the file
218: or before the beginning of the file, the terminal bell is rung to
219: indicate this fact.
220: The -q command line option tells
221: .I less
222: not to ring the bell at such times.
223: If the terminal has a "visual bell", it is used instead.
224: .IP -Q
225: Even if -q is given,
226: .I less
227: will ring the bell on certain other errors,
228: such as typing an invalid character.
229: The -Q command line option tells
230: .I less
231: to be quiet all the time; that is, never ring the terminal bell.
232: If the terminal has a "visual bell", it is used instead.
233: .IP -e
234: Normally the only way to exit less is via the "q" command.
235: The -e command line option tells less to automatically exit
236: the second time it reaches end-of-file.
237: .IP -u
238: If the -u command line option is given,
239: backspaces are treated as printable characters;
240: that is, they are sent to the terminal when they appear in the input.
241: .IP -U
242: If the -U command line option is given,
243: backspaces are printed as the two character sequence "^H".
244: If neither -u nor -U is given,
245: backspaces which appear adjacent to an underscore character
246: are treated specially:
247: the underlined text is displayed
248: using the terminal's hardware underlining capability.
249: .IP -w
250: Normally,
251: .I less
252: uses a tilde character to represent lines past the end of the file.
253: The -w option causes blank lines to be used instead.
254: .IP -d
255: Normally,
256: .I less
257: will complain if the terminal is dumb; that is, lacks some important capability,
258: such as the ability to clear the screen or scroll backwards.
259: The -d flag suppresses this complaint
260: (but does not otherwise change the behavior of the program on a dumb terminal).
261: .IP -p
262: Normally,
263: .I less
264: will repaint the screen by scrolling from the bottom of the screen.
265: If the -p flag is set, when
266: .I less
267: needs to change the entire display, it will clear the screen
268: and paint from the top line down.
269: .IP -h
270: Normally,
271: .I less
272: will scroll backwards when backwards movement is necessary.
273: The -h option specifies a maximum number of lines to scroll backwards.
274: If it is necessary to move backwards more than this many lines,
275: the screen is repainted in a forward direction.
276: (If the terminal does not have the ability to scroll
277: backwards, -h0 is implied.)
278: .IP -x
279: The -x\fIn\fR command line option sets tab stops every \fIn\fR positions.
280: The default for \fIn\fR is 8.
281: .IP -b
282: The -b\fIn\fR command line option tells
283: .I less
284: to use a non-standard buffer size.
285: There are two standard (default) buffer sizes,
286: one is used when a file is being read and the other
287: when a pipe (standard input) is being read.
288: The current defaults are 5 buffers for files and 12 for pipes.
289: (Buffers are 1024 bytes.)
290: The number \fIn\fR specifies a different number of buffers to use.
291: The -b may be followed by "f", in which case only
292: the file default is changed, or by "p" in which case only the
293: pipe default is changed. Otherwise, both are changed.
294: .IP -c
295: Normally, when data is read by
296: .I less,
297: it is scanned to ensure that bit 7 (the high order bit) is turned off in
298: each byte read, and to ensure that there are no null (zero) bytes in
299: the data (null bytes are turned into "@" characters).
300: If the data is known to be "clean",
301: the -c command line option will tell
302: .I less
303: to skip this checking, causing an imperceptible speed improvement.
304: (However, if the data is not "clean", unpredicatable results may occur.)
305: .IP +
306: If a command line option begins with \fB+\fR,
307: the remainder of that option is taken to be an initial command to
308: .I less.
309: For example, +G tells
310: .I less
311: to start at the end of the file rather than the beginning,
312: and +/xyz tells it to start at the first occurence of "xyz" in the file.
313: As a special case, +<number> acts like +<number>g;
314: that is, it starts the display at the specified line number
315: (however, see the caveat under the "g" command above).
316: If the option starts with \fB++\fR, the initial command applies to
317: every file being viewed, not just the first one.
318:
319: .SH BUGS
320: When used on standard input (rather than a file), you can move
321: backwards only a finite amount, corresponding to that portion
322: of the file which is still buffered.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.