]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/less/less.nro
net80211: correct length check in ieee80211_ies_expand()
[FreeBSD/FreeBSD.git] / contrib / less / less.nro
1 '\" t
2 .TH LESS 1 "Version 581.2: 28 Apr 2021"
3 .SH NAME
4 less \- opposite of more
5 .SH SYNOPSIS
6 .B "less \-?"
7 .br
8 .B "less \-\-help"
9 .br
10 .B "less \-V"
11 .br
12 .B "less \-\-version"
13 .br
14 .B "less [\-[+]aABcCdeEfFgGiIJKLmMnNqQrRsSuUVwWX~]"
15 .br
16 .B "     [\-b \fIspace\/\fP] [\-h \fIlines\/\fP] [\-j \fIline\/\fP] [\-k \fIkeyfile\/\fP]"
17 .br
18 .B "     [\-{oO} \fIlogfile\/\fP] [\-p \fIpattern\/\fP] [\-P \fIprompt\/\fP] [\-t \fItag\/\fP]"
19 .br
20 .B "     [\-T \fItagsfile\/\fP] [\-x \fItab\/\fP,...] [\-y \fIlines\/\fP] [\-[z] \fIlines\/\fP]"
21 .br
22 .B "     [\-# \fIshift\/\fP] [+[+]\fIcmd\/\fP] [\-\-] [\fIfilename\/\fP]..."
23 .br
24 (See the OPTIONS section for alternate option syntax with long option names.)
25 .
26 .SH DESCRIPTION
27 .I Less
28 is a program similar to
29 .IR more (1),
30 but which allows backward movement
31 in the file as well as forward movement.
32 Also,
33 .I less
34 does not have to read the entire input file before starting,
35 so with large input files it starts up faster than text editors like
36 .IR vi (1).
37 .I Less
38 uses termcap (or terminfo on some systems),
39 so it can run on a variety of terminals.
40 There is even limited support for hardcopy terminals.
41 (On a hardcopy terminal, lines which should be printed at the top
42 of the screen are prefixed with a caret.)
43 .PP
44 Commands are based on both
45 .I more
46 and
47 .IR vi .
48 Commands may be preceded by a decimal number,
49 called N in the descriptions below.
50 The number is used by some commands, as indicated.
51 .
52 .SH COMMANDS
53 In the following descriptions, ^X means control-X.
54 ESC stands for the ESCAPE key; for example ESC-v means the
55 two character sequence "ESCAPE", then "v".
56 .IP "h or H"
57 Help: display a summary of these commands.
58 If you forget all the other commands, remember this one.
59 .IP "SPACE or ^V or f or ^F"
60 Scroll forward N lines, default one window (see option \-z below).
61 If N is more than the screen size, only the final screenful is displayed.
62 Warning: some systems use ^V as a special literalization character.
63 .IP "z"
64 Like SPACE, but if N is specified, it becomes the new window size.
65 .IP "ESC-SPACE"
66 Like SPACE, but scrolls a full screenful, even if it reaches
67 end-of-file in the process.
68 .IP "ENTER or RETURN or ^N or e or ^E or j or ^J"
69 Scroll forward N lines, default 1.
70 The entire N lines are displayed, even if N is more than the screen size.
71 .IP "d or ^D"
72 Scroll forward N lines, default one half of the screen size.
73 If N is specified, it becomes the new default for
74 subsequent d and u commands.
75 .IP "b or ^B or ESC-v"
76 Scroll backward N lines, default one window (see option \-z below).
77 If N is more than the screen size, only the final screenful is displayed.
78 .IP "w"
79 Like ESC-v, but if N is specified, it becomes the new window size.
80 .IP "y or ^Y or ^P or k or ^K"
81 Scroll backward N lines, default 1.
82 The entire N lines are displayed, even if N is more than the screen size.
83 Warning: some systems use ^Y as a special job control character.
84 .IP "u or ^U"
85 Scroll backward N lines, default one half of the screen size.
86 If N is specified, it becomes the new default for
87 subsequent d and u commands.
88 .IP "J"
89 Like j, but continues to scroll beyond the end of the file.
90 .IP "K or Y"
91 Like k, but continues to scroll beyond the beginning of the file.
92 .IP "ESC-) or RIGHTARROW"
93 Scroll horizontally right N characters, default half the screen width
94 (see the \-# option).
95 If a number N is specified, it becomes the default for future RIGHTARROW
96 and LEFTARROW commands.
97 While the text is scrolled, it acts as though the \-S option
98 (chop lines) were in effect.
99 .IP "ESC-( or LEFTARROW"
100 Scroll horizontally left N characters, default half the screen width
101 (see the \-# option).
102 If a number N is specified, it becomes the default for future RIGHTARROW
103 and LEFTARROW commands.
104 .IP "ESC-} or ^RIGHTARROW"
105 Scroll horizontally right to show the end of the longest displayed line.
106 .IP "ESC-{ or ^LEFTARROW"
107 Scroll horizontally left back to the first column.
108 .IP "r or ^R or ^L"
109 Repaint the screen.
110 .IP R
111 Repaint the screen, discarding any buffered input.
112 That is, reload the current file.
113 Useful if the file is changing while it is being viewed.
114 .IP "F"
115 Scroll forward, and keep trying to read when the
116 end of file is reached.
117 Normally this command would be used when already at the end of the file.
118 It is a way to monitor the tail of a file which is growing
119 while it is being viewed.
120 (The behavior is similar to the "tail \-f" command.)
121 To stop waiting for more data, enter the interrupt character (usually ^C).
122 On some systems you can also use ^X.
123 .IP "ESC-F"
124 Like F, but as soon as a line is found which matches
125 the last search pattern, the terminal bell is rung
126 and forward scrolling stops.
127 .IP "g or < or ESC-<"
128 Go to line N in the file, default 1 (beginning of file).
129 (Warning: this may be slow if N is large.)
130 .IP "G or > or ESC->"
131 Go to line N in the file, default the end of the file.
132 (Warning: this may be slow if N is large,
133 or if N is not specified and
134 standard input, rather than a file, is being read.)
135 .IP "ESC-G"
136 Same as G, except if no number N is specified and the input is standard input,
137 goes to the last line which is currently buffered.
138 .IP "p or %"
139 Go to a position N percent into the file.
140 N should be between 0 and 100, and may contain a decimal point.
141 .IP "P"
142 Go to the line containing byte offset N in the file.
143 .IP "{"
144 If a left curly bracket appears in the top line displayed
145 on the screen,
146 the { command will go to the matching right curly bracket.
147 The matching right curly bracket is positioned on the bottom
148 line of the screen.
149 If there is more than one left curly bracket on the top line,
150 a number N may be used to specify the N-th bracket on the line.
151 .IP "}"
152 If a right curly bracket appears in the bottom line displayed
153 on the screen,
154 the } command will go to the matching left curly bracket.
155 The matching left curly bracket is positioned on the top
156 line of the screen.
157 If there is more than one right curly bracket on the top line,
158 a number N may be used to specify the N-th bracket on the line.
159 .IP "("
160 Like {, but applies to parentheses rather than curly brackets.
161 .IP ")"
162 Like }, but applies to parentheses rather than curly brackets.
163 .IP "["
164 Like {, but applies to square brackets rather than curly brackets.
165 .IP "]"
166 Like }, but applies to square brackets rather than curly brackets.
167 .IP "ESC-^F"
168 Followed by two characters,
169 acts like {, but uses the two characters as open and close brackets,
170 respectively.
171 For example, "ESC ^F < >" could be used to
172 go forward to the > which matches the < in the top displayed line.
173 .IP "ESC-^B"
174 Followed by two characters,
175 acts like }, but uses the two characters as open and close brackets,
176 respectively.
177 For example, "ESC ^B < >" could be used to
178 go backward to the < which matches the > in the bottom displayed line.
179 .IP m
180 Followed by any lowercase or uppercase letter,
181 marks the first displayed line with that letter.
182 If the status column is enabled via the \-J option,
183 the status column shows the marked line.
184 .IP M
185 Acts like m, except the last displayed line is marked
186 rather than the first displayed line.
187 .IP "'"
188 (Single quote.)
189 Followed by any lowercase or uppercase letter, returns to the position which
190 was previously marked with that letter.
191 Followed by another single quote, returns to the position at
192 which the last "large" movement command was executed.
193 Followed by a ^ or $, jumps to the beginning or end of the
194 file respectively.
195 Marks are preserved when a new file is examined,
196 so the ' command can be used to switch between input files.
197 .IP "^X^X"
198 Same as single quote.
199 .IP "ESC-m"
200 Followed by any lowercase or uppercase letter,
201 clears the mark identified by that letter.
202 .IP /pattern
203 Search forward in the file for the N-th line containing the pattern.
204 N defaults to 1.
205 The pattern is a regular expression, as recognized by
206 the regular expression library supplied by your system.
207 The search starts at the first line displayed
208 (but see the \-a and \-j options, which change this).
209 .sp
210 Certain characters are special
211 if entered at the beginning of the pattern;
212 they modify the type of search rather than become part of the pattern:
213 .RS
214 .IP "^N or !"
215 Search for lines which do NOT match the pattern.
216 .IP "^E or *"
217 Search multiple files.
218 That is, if the search reaches the END of the current file
219 without finding a match,
220 the search continues in the next file in the command line list.
221 .IP "^F or @"
222 Begin the search at the first line of the FIRST file
223 in the command line list,
224 regardless of what is currently displayed on the screen
225 or the settings of the \-a or \-j options.
226 .IP "^K"
227 Highlight any text which matches the pattern on the current screen,
228 but don't move to the first match (KEEP current position).
229 .IP "^R"
230 Don't interpret regular expression metacharacters;
231 that is, do a simple textual comparison.
232 .IP "^W"
233 WRAP around the current file.
234 That is, if the search reaches the end of the current file
235 without finding a match, the search continues from the first line of the
236 current file up to the line where it started.
237 .RE
238 .IP ?pattern
239 Search backward in the file for the N-th line containing the pattern.
240 The search starts at the last line displayed
241 (but see the \-a and \-j options, which change this).
242 .sp
243 Certain characters are special as in the / command:
244 .RS
245 .IP "^N or !"
246 Search for lines which do NOT match the pattern.
247 .IP "^E or *"
248 Search multiple files.
249 That is, if the search reaches the beginning of the current file
250 without finding a match,
251 the search continues in the previous file in the command line list.
252 .IP "^F or @"
253 Begin the search at the last line of the last file
254 in the command line list,
255 regardless of what is currently displayed on the screen
256 or the settings of the \-a or \-j options.
257 .IP "^K"
258 As in forward searches.
259 .IP "^R"
260 As in forward searches.
261 .IP "^W"
262 WRAP around the current file.
263 That is, if the search reaches the beginning of the current file
264 without finding a match, the search continues from the last line of the
265 current file up to the line where it started.
266 .RE
267 .IP "ESC-/pattern"
268 Same as "/*".
269 .IP "ESC-?pattern"
270 Same as "?*".
271 .IP n
272 Repeat previous search, for N-th line containing the last pattern.
273 If the previous search was modified by ^N, the search is made for the
274 N-th line NOT containing the pattern.
275 If the previous search was modified by ^E, the search continues
276 in the next (or previous) file if not satisfied in the current file.
277 If the previous search was modified by ^R, the search is done
278 without using regular expressions.
279 There is no effect if the previous search was modified by ^F or ^K.
280 .IP N
281 Repeat previous search, but in the reverse direction.
282 .IP "ESC-n"
283 Repeat previous search, but crossing file boundaries.
284 The effect is as if the previous search were modified by *.
285 .IP "ESC-N"
286 Repeat previous search, but in the reverse direction
287 and crossing file boundaries.
288 .IP "ESC-u"
289 Undo search highlighting.
290 Turn off highlighting of strings matching the current search pattern.
291 If highlighting is already off because of a previous ESC-u command,
292 turn highlighting back on.
293 Any search command will also turn highlighting back on.
294 (Highlighting can also be disabled by toggling the \-G option;
295 in that case search commands do not turn highlighting back on.)
296 .IP "ESC-U"
297 Like ESC-u but also clears the saved search pattern.
298 If the status column is enabled via the \-J option,
299 this clears all search matches marked in the status column.
300 .IP "&pattern"
301 Display only lines which match the pattern;
302 lines which do not match the pattern are not displayed.
303 If pattern is empty (if you type & immediately followed by ENTER),
304 any filtering is turned off, and all lines are displayed.
305 While filtering is in effect, an ampersand is displayed at the
306 beginning of the prompt,
307 as a reminder that some lines in the file may be hidden.
308 Multiple & commands may be entered, in which case only lines
309 which match all of the patterns will be displayed.
310 .sp
311 Certain characters are special as in the / command:
312 .RS
313 .IP "^N or !"
314 Display only lines which do NOT match the pattern.
315 .IP "^R"
316 Don't interpret regular expression metacharacters;
317 that is, do a simple textual comparison.
318 .RE
319 .IP ":e [filename]"
320 Examine a new file.
321 If the filename is missing, the "current" file (see the :n and :p commands
322 below) from the list of files in the command line is re-examined.
323 A percent sign (%) in the filename is replaced by the name of the
324 current file.
325 A pound sign (#) is replaced by the name of the previously examined file.
326 However, two consecutive percent signs are simply
327 replaced with a single percent sign.
328 This allows you to enter a filename that contains a percent sign
329 in the name.
330 Similarly, two consecutive pound signs are replaced with a single pound sign.
331 The filename is inserted into the command line list of files
332 so that it can be seen by subsequent :n and :p commands.
333 If the filename consists of several files, they are all inserted into
334 the list of files and the first one is examined.
335 If the filename contains one or more spaces,
336 the entire filename should be enclosed in double quotes
337 (also see the \-" option).
338 .IP "^X^V or E"
339 Same as :e.
340 Warning: some systems use ^V as a special literalization character.
341 On such systems, you may not be able to use ^V.
342 .IP ":n"
343 Examine the next file (from the list of files given in the command line).
344 If a number N is specified, the N-th next file is examined.
345 .IP ":p"
346 Examine the previous file in the command line list.
347 If a number N is specified, the N-th previous file is examined.
348 .IP ":x"
349 Examine the first file in the command line list.
350 If a number N is specified, the N-th file in the list is examined.
351 .IP ":d"
352 Remove the current file from the list of files.
353 .IP "t"
354 Go to the next tag, if there were more than one matches for the current tag.
355 See the \-t option for more details about tags.
356 .IP "T"
357 Go to the previous tag, if there were more than one matches for the current tag.
358 .IP "= or ^G or :f"
359 Prints some information about the file being viewed,
360 including its name
361 and the line number and byte offset of the bottom line being displayed.
362 If possible, it also prints the length of the file,
363 the number of lines in the file
364 and the percent of the file above the last displayed line.
365 .IP \-
366 Followed by one of the command line option letters (see OPTIONS below),
367 this will change the setting of that option
368 and print a message describing the new setting.
369 If a ^P (CONTROL-P) is entered immediately after the dash,
370 the setting of the option is changed but no message is printed.
371 If the option letter has a numeric value (such as \-b or \-h),
372 or a string value (such as \-P or \-t),
373 a new value may be entered after the option letter.
374 If no new value is entered, a message describing
375 the current setting is printed and nothing is changed.
376 .IP \-\-
377 Like the \- command, but takes a long option name (see OPTIONS below)
378 rather than a single option letter.
379 You must press ENTER or RETURN after typing the option name.
380 A ^P immediately after the second dash suppresses printing of a
381 message describing the new setting, as in the \- command.
382 .IP \-+
383 Followed by one of the command line option letters
384 this will reset the option to its default setting
385 and print a message describing the new setting.
386 (The "\-+\fIX\fP" command does the same thing
387 as "\-+\fIX\fP" on the command line.)
388 This does not work for string-valued options.
389 .IP \-\-+
390 Like the \-+ command, but takes a long option name
391 rather than a single option letter.
392 .IP \-!
393 Followed by one of the command line option letters,
394 this will reset the option to the "opposite" of its default setting
395 and print a message describing the new setting.
396 This does not work for numeric or string-valued options.
397 .IP \-\-!
398 Like the \-!\& command, but takes a long option name
399 rather than a single option letter.
400 .IP _
401 (Underscore.)
402 Followed by one of the command line option letters,
403 this will print a message describing the current setting of that option.
404 The setting of the option is not changed.
405 .IP __
406 (Double underscore.)
407 Like the _ (underscore) command, but takes a long option name
408 rather than a single option letter.
409 You must press ENTER or RETURN after typing the option name.
410 .IP +cmd
411 Causes the specified cmd to be executed each time a new file is examined.
412 For example, +G causes
413 .I less
414 to initially display each file starting at the end
415 rather than the beginning.
416 .IP V
417 Prints the version number of
418 .I less
419 being run.
420 .IP "q or Q or :q or :Q or ZZ"
421 Exits
422 .IR less .
423 .PP
424 The following
425 four
426 commands may or may not be valid, depending on your particular installation.
427 .
428 .IP v
429 Invokes an editor to edit the current file being viewed.
430 The editor is taken from the environment variable VISUAL if defined,
431 or EDITOR if VISUAL is not defined,
432 or defaults to "vi" if neither VISUAL nor EDITOR is defined.
433 See also the discussion of LESSEDIT under the section on PROMPTS below.
434 .IP "! shell-command"
435 Invokes a shell to run the shell-command given.
436 A percent sign (%) in the command is replaced by the name of the
437 current file.
438 A pound sign (#) is replaced by the name of the previously examined file.
439 "!!" repeats the last shell command.
440 "!" with no shell command simply invokes a shell.
441 On Unix systems, the shell is taken from the environment variable SHELL,
442 or defaults to "sh".
443 On MS-DOS and OS/2 systems, the shell is the normal command processor.
444 .IP "| <m> shell-command"
445 <m> represents any mark letter.
446 Pipes a section of the input file to the given shell command.
447 The section of the file to be piped is between the position marked by
448 the letter and the current screen.
449 The entire current screen is included, regardless of whether the
450 marked position is before or after the current screen.
451 <m> may also be ^ or $ to indicate beginning or end of file respectively.
452 If <m> is \&.\& or newline, the current screen is piped.
453 .IP "s filename"
454 Save the input to a file.
455 This only works if the input is a pipe, not an ordinary file.
456 .
457 .SH OPTIONS
458 Command line options are described below.
459 Most options may be changed while
460 .I less
461 is running, via the "\-" command.
462 .PP
463 Most options may be given in one of two forms:
464 either a dash followed by a single letter,
465 or two dashes followed by a long option name.
466 A long option name may be abbreviated as long as
467 the abbreviation is unambiguous.
468 For example, \-\-quit-at-eof may be abbreviated \-\-quit, but not
469 \-\-qui, since both \-\-quit-at-eof and \-\-quiet begin with \-\-qui.
470 Some long option names are in uppercase, such as \-\-QUIT-AT-EOF, as
471 distinct from \-\-quit-at-eof.
472 Such option names need only have their first letter capitalized;
473 the remainder of the name may be in either case.
474 For example, \-\-Quit-at-eof is equivalent to \-\-QUIT-AT-EOF.
475 .PP
476 Options are also taken from the environment variable "LESS".
477 For example,
478 to avoid typing "less \-options \&...\&" each time
479 .I less
480 is invoked, you might tell
481 .IR csh :
482 .sp
483 setenv LESS "\-options"
484 .sp
485 or if you use
486 .IR sh :
487 .sp
488 LESS="\-options"; export LESS
489 .sp
490 On MS-DOS, you don't need the quotes, but you should replace any
491 percent signs in the options string by double percent signs.
492 .sp
493 The environment variable is parsed before the command line,
494 so command line options override the LESS environment variable.
495 If an option appears in the LESS variable, it can be reset
496 to its default value on the command line by beginning the command
497 line option with "\-+".
498 .sp
499 Some options like \-k or \-D require a string to follow the option letter.
500 The string for that option is considered to end when a dollar sign ($) is found.
501 For example, you can set two \-D options on MS-DOS like this:
502 .sp
503 LESS="Dn9.1$Ds4.1"
504 .sp
505 If the \-\-use-backslash option appears earlier in the options, then
506 a dollar sign or backslash may be included literally in an option string
507 by preceding it with a backslash.
508 If the \-\-use-backslash option is not in effect, then backslashes are
509 not treated specially, and there is no way to include a dollar sign
510 in the option string.
511 .IP "\-? or \-\-help"
512 This option displays a summary of the commands accepted by
513 .I less
514 (the same as the h command).
515 (Depending on how your shell interprets the question mark,
516 it may be necessary to quote the question mark, thus: "\-\e?".)
517 .IP "\-a or \-\-search-skip-screen"
518 By default, forward searches start at the top of the displayed screen
519 and backwards searches start at the bottom of the displayed screen
520 (except for repeated searches invoked by the n or N commands,
521 which start after or before the "target" line respectively;
522 see the \-j option for more about the target line).
523 The \-a option causes forward searches to instead start at
524 the bottom of the screen
525 and backward searches to start at the top of the screen,
526 thus skipping all lines displayed on the screen.
527 .IP "\-A or \-\-SEARCH-SKIP-SCREEN"
528 Causes all forward searches (not just non-repeated searches)
529 to start just after the target line, and all backward searches
530 to start just before the target line.
531 Thus, forward searches will skip part of the displayed screen
532 (from the first line up to and including the target line).
533 Similarly backwards searches will skip the displayed screen
534 from the last line up to and including the target line.
535 This was the default behavior in less versions prior to 441.
536 .IP "\-b\fIn\fP or \-\-buffers=\fIn\fP"
537 Specifies the amount of buffer space
538 .I less
539 will use for each file, in units of kilobytes (1024 bytes).
540 By default 64\ KB of buffer space is used for each file
541 (unless the file is a pipe; see the \-B option).
542 The \-b option specifies instead that \fIn\fP kilobytes of
543 buffer space should be used for each file.
544 If \fIn\fP is \-1, buffer space is unlimited; that is,
545 the entire file can be read into memory.
546 .IP "\-B or \-\-auto-buffers"
547 By default, when data is read from a pipe,
548 buffers are allocated automatically as needed.
549 If a large amount of data is read from the pipe, this can cause
550 a large amount of memory to be allocated.
551 The \-B option disables this automatic allocation of buffers for pipes,
552 so that only 64\ KB
553 (or the amount of space specified by the \-b option)
554 is used for the pipe.
555 Warning: use of \-B can result in erroneous display, since only the
556 most recently viewed part of the piped data is kept in memory;
557 any earlier data is lost.
558 .IP "\-c or \-\-clear-screen"
559 Causes full screen repaints to be painted from the top line down.
560 By default,
561 full screen repaints are done by scrolling from the bottom of the screen.
562 .IP "\-C or \-\-CLEAR-SCREEN"
563 Same as \-c, for compatibility with older versions of
564 .IR less .
565 .IP "\-d or \-\-dumb"
566 The \-d option suppresses the error message
567 normally displayed if the terminal is dumb;
568 that is, lacks some important capability,
569 such as the ability to clear the screen or scroll backward.
570 The \-d option does not otherwise change the behavior of
571 .I less
572 on a dumb terminal.
573 .IP "\-D\fBx\fP\fIcolor\fP or \-\-color=\fBx\fP\fIcolor\fP"
574 Changes the color of different parts of the displayed text.
575 \fBx\fP is a single character which selects the type of text 
576 whose color is being set:
577 .RS
578 .IP "B"
579 Binary characters.
580 .IP "C"
581 Control characters.
582 .IP "E"
583 Errors and informational messages.
584 .IP "M"
585 Mark letters in the status column.
586 .IP "N"
587 Line numbers enabled via the \-N option.
588 .IP "P"
589 Prompts.
590 .IP "R"
591 The rscroll character.
592 .IP "S"
593 Search results.
594 .IP "W"
595 The highlight enabled via the \-w option.
596 .IP "d"
597 Bold text.
598 .IP "k"
599 Blinking text.
600 .IP "s"
601 Standout text.
602 .IP "u"
603 Underlined text.
604 .RE
605  
606 .RS
607 The uppercase letters can be used only when the \-\-use-color option is enabled.
608 When text color is specified by both an uppercase letter and a lowercase letter,
609 the uppercase letter takes precedence. 
610 For example, error messages are normally displayed as standout text.
611 So if both "s" and "E" are given a color, the "E" color applies
612 to error messages, and the "s" color applies to other standout text.
613 The "d" and "u" letters refer to bold and underline text formed by 
614 overstriking with backspaces (see the \-u option), 
615 not to text using ANSI escape sequences with the \-R option.
616 .PP
617 A lowercase letter may be followed by a + to indicate that
618 both the normal format change and the specified color should both be used.
619 For example, \-Dug displays underlined text as green without underlining;
620 the green color has replaced the usual underline formatting.
621 But \-Du+g displays underlined text as both green and in underlined format.
622 .PP
623 \fIcolor\fP is either a 4-bit color string or an 8-bit color string:
624 .PP
625 A 4-bit color string is zero, one or two characters, where 
626 the first character specifies the foreground color and 
627 the second specifies the background color as follows:
628 .IP "b"
629 Blue
630 .IP "c"
631 Cyan
632 .IP "g"
633 Green
634 .IP "k"
635 Black
636 .IP "m"
637 Magenta
638 .IP "r"
639 Red
640 .IP "w"
641 White
642 .IP "y"
643 Yellow
644 .PP
645 The corresponding upper-case letter denotes a brighter shade of the color.
646 For example, \-DNGk displays line numbers as bright green text on a black 
647 background, and \-DEbR displays error messages as blue text on a 
648 bright red background.
649 If either character is a "-" or is omitted, the corresponding color 
650 is set to that of normal text.
651 .PP
652 An 8-bit color string is one or two decimal integers separated by a dot,
653 where the first integer specifies the foreground color and 
654 the second specifies the background color.
655 Each integer is a value between 0 and 255 inclusive which selects
656 a "CSI 38;5" color value (see
657 .br
658 .nh
659 https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters)
660 .hy
661 If either integer is a "-" or is omitted,
662 the corresponding color is set to that of normal text.
663 On MS-DOS versions of 
664 .IR less ,
665 8-bit color is not supported; instead, decimal values are interpreted as 4-bit
666 CHAR_INFO.Attributes values
667 (see 
668 .br
669 .nh
670 https://docs.microsoft.com/en-us/windows/console/char-info-str).
671 .hy
672 .RE
673 .IP "\-e or \-\-quit-at-eof"
674 Causes
675 .I less
676 to automatically exit
677 the second time it reaches end-of-file.
678 By default, the only way to exit
679 .I less
680 is via the "q" command.
681 .IP "\-E or \-\-QUIT-AT-EOF"
682 Causes
683 .I less
684 to automatically exit the first time it reaches end-of-file.
685 .IP "\-f or \-\-force"
686 Forces non-regular files to be opened.
687 (A non-regular file is a directory or a device special file.)
688 Also suppresses the warning message when a binary file is opened.
689 By default,
690 .I less
691 will refuse to open non-regular files.
692 Note that some operating systems will not allow directories
693 to be read, even if \-f is set.
694 .IP "\-F or \-\-quit-if-one-screen"
695 Causes
696 .I less
697 to automatically exit
698 if the entire file can be displayed on the first screen.
699 .IP "\-g or \-\-hilite-search"
700 Normally,
701 .I less
702 will highlight ALL strings which match the last search command.
703 The \-g option changes this behavior to highlight only the particular string
704 which was found by the last search command.
705 This can cause
706 .I less
707 to run somewhat faster than the default.
708 .IP "\-G or \-\-HILITE-SEARCH"
709 The \-G option suppresses all highlighting of strings found by search commands.
710 .IP "\-h\fIn\fP or \-\-max-back-scroll=\fIn\fP"
711 Specifies a maximum number of lines to scroll backward.
712 If it is necessary to scroll backward more than \fIn\fP lines,
713 the screen is repainted in a forward direction instead.
714 (If the terminal does not have the ability to scroll
715 backward, \-h0 is implied.)
716 .IP "\-i or \-\-ignore-case"
717 Causes searches to ignore case; that is,
718 uppercase and lowercase are considered identical.
719 This option is ignored if any uppercase letters
720 appear in the search pattern;
721 in other words,
722 if a pattern contains uppercase letters, then that search does not ignore case.
723 .IP "\-I or \-\-IGNORE-CASE"
724 Like \-i, but searches ignore case even if
725 the pattern contains uppercase letters.
726 .IP "\-j\fIn\fP or \-\-jump-target=\fIn\fP"
727 Specifies a line on the screen where the "target" line
728 is to be positioned.
729 The target line is the line specified by any command to
730 search for a pattern, jump to a line number,
731 jump to a file percentage or jump to a tag.
732 The screen line may be specified by a number: the top line on the screen
733 is 1, the next is 2, and so on.
734 The number may be negative to specify a line relative to the bottom
735 of the screen: the bottom line on the screen is \-1, the second
736 to the bottom is \-2, and so on.
737 Alternately, the screen line may be specified as a fraction of the height
738 of the screen, starting with a decimal point: \&.5 is in the middle of the
739 screen, \&.3 is three tenths down from the first line, and so on.
740 If the line is specified as a fraction, the actual line number
741 is recalculated if the terminal window is resized, so that the
742 target line remains at the specified fraction of the screen height.
743 If any form of the \-j option is used,
744 repeated forward searches (invoked with "n" or "N")
745 begin at the line immediately after the target line,
746 and repeated backward searches begin at the target line,
747 unless changed by \-a or \-A.
748 For example, if "\-j4" is used, the target line is the
749 fourth line on the screen, so forward searches begin at the fifth line
750 on the screen.
751 However nonrepeated searches (invoked with "/" or "?")
752 always begin at the start or end of the current screen respectively.
753 .IP "\-J or \-\-status-column"
754 Displays a status column at the left edge of the screen.
755 The status column shows the lines that matched the current search,
756 and any lines that are marked (via the m or M command).
757 .IP "\-k\fIfilename\fP or \-\-lesskey-file=\fIfilename\fP"
758 Causes
759 .I less
760 to open and interpret the named file as a
761 .IR lesskey (1)
762 file.
763 Multiple \-k options may be specified.
764 If the LESSKEY or LESSKEY_SYSTEM environment variable is set, or
765 if a lesskey file is found in a standard place (see KEY BINDINGS),
766 it is also used as a
767 .I lesskey
768 file.
769 .IP "\-K or \-\-quit-on-intr"
770 Causes
771 .I less
772 to exit immediately (with status 2)
773 when an interrupt character (usually ^C) is typed.
774 Normally, an interrupt character causes
775 .I less
776 to stop whatever it is doing and return to its command prompt.
777 Note that use of this option makes it impossible to return to the
778 command prompt from the "F" command.
779 .IP "\-L or \-\-no-lessopen"
780 Ignore the LESSOPEN environment variable
781 (see the INPUT PREPROCESSOR section below).
782 This option can be set from within
783 .IR less ,
784 but it will apply only to files opened subsequently, not to the
785 file which is currently open.
786 .IP "\-m or \-\-long-prompt"
787 Causes
788 .I less
789 to prompt verbosely (like \fImore\fP),
790 with the percent into the file.
791 By default,
792 .I less
793 prompts with a colon.
794 .IP "\-M or \-\-LONG-PROMPT"
795 Causes
796 .I less
797 to prompt even more verbosely than
798 .IR more .
799 .IP "\-n or \-\-line-numbers"
800 Suppresses line numbers.
801 The default (to use line numbers) may cause
802 .I less
803 to run more slowly in some cases, especially with a very large input file.
804 Suppressing line numbers with the \-n option will avoid this problem.
805 Using line numbers means: the line number will be displayed in the verbose
806 prompt and in the = command,
807 and the v command will pass the current line number to the editor
808 (see also the discussion of LESSEDIT in PROMPTS below).
809 .IP "\-N or \-\-LINE-NUMBERS"
810 Causes a line number to be displayed at the beginning of
811 each line in the display.
812 .IP "\-o\fIfilename\fP or \-\-log-file=\fIfilename\fP"
813 Causes
814 .I less
815 to copy its input to the named file as it is being viewed.
816 This applies only when the input file is a pipe,
817 not an ordinary file.
818 If the file already exists,
819 .I less
820 will ask for confirmation before overwriting it.
821 .IP "\-O\fIfilename\fP or \-\-LOG-FILE=\fIfilename\fP"
822 The \-O option is like \-o, but it will overwrite an existing
823 file without asking for confirmation.
824 .sp
825 If no log file has been specified,
826 the \-o and \-O options can be used from within
827 .I less
828 to specify a log file.
829 Without a file name, they will simply report the name of the log file.
830 The "s" command is equivalent to specifying \-o from within
831 .IR less .
832 .IP "\-p\fIpattern\fP or \-\-pattern=\fIpattern\fP"
833 The \-p option on the command line is equivalent to
834 specifying +/\fIpattern\fP;
835 that is, it tells
836 .I less
837 to start at the first occurrence of \fIpattern\fP in the file.
838 .IP "\-P\fIprompt\fP or \-\-prompt=\fIprompt\fP"
839 Provides a way to tailor the three prompt
840 styles to your own preference.
841 This option would normally be put in the LESS environment
842 variable, rather than being typed in with each
843 .I less
844 command.
845 Such an option must either be the last option in the LESS variable,
846 or be terminated by a dollar sign.
847  \-Ps followed by a string changes the default (short) prompt
848 to that string.
849  \-Pm changes the medium (\-m) prompt.
850  \-PM changes the long (\-M) prompt.
851  \-Ph changes the prompt for the help screen.
852  \-P= changes the message printed by the = command.
853  \-Pw changes the message printed while waiting for data (in the F command).
854 .sp 1
855 All prompt strings consist of a sequence of
856 letters and special escape sequences.
857 See the section on PROMPTS for more details.
858 .IP "\-q or \-\-quiet or \-\-silent"
859 Causes moderately "quiet" operation:
860 the terminal bell is not rung
861 if an attempt is made to scroll past the end of the file
862 or before the beginning of the file.
863 If the terminal has a "visual bell", it is used instead.
864 The bell will be rung on certain other errors,
865 such as typing an invalid character.
866 The default is to ring the terminal bell in all such cases.
867 .IP "\-Q or \-\-QUIET or \-\-SILENT"
868 Causes totally "quiet" operation:
869 the terminal bell is never rung.
870 If the terminal has a "visual bell", it is used in all cases
871 where the terminal bell would have been rung.
872 .IP "\-r or \-\-raw-control-chars"
873 Causes "raw" control characters to be displayed.
874 The default is to display control characters using the caret notation;
875 for example, a control-A (octal 001) is displayed as "^A".
876 Warning: when the \-r option is used,
877 .I less
878 cannot keep track of the actual appearance of the screen
879 (since this depends on how the screen responds to
880 each type of control character).
881 Thus, various display problems may result,
882 such as long lines being split in the wrong place.
883 .sp
884 USE OF THE \-r OPTION IS NOT RECOMMENDED.
885 .IP "\-R or \-\-RAW-CONTROL-CHARS"
886 Like \-r, but only ANSI "color" escape sequences and OSC 8 hyperlink
887 sequences are output in "raw" form.
888 Unlike \-r, the screen appearance is maintained correctly,
889 provided that there are no escape sequences in the file 
890 other than these types of escape sequences.
891 Color escape sequences are only supported when the color
892 is changed within one line, not across lines. 
893 In other words, the beginning of each line is assumed to be
894 normal (non-colored), regardless of any escape sequences in previous lines.
895 For the purpose of keeping track of screen appearance,
896 these escape sequences are assumed to not move the cursor.
897 .sp
898 OSC 8 hyperlinks are sequences of the form:
899 .sp
900         ESC ] 8 ; \&...\& \\7
901 .sp
902 The terminating sequence may be either a BEL character (\\7) 
903 or the two-character sequence "ESC \\".
904 .sp
905 ANSI color escape sequences are sequences of the form:
906 .sp
907         ESC [ \&...\& m
908 .sp
909 where the "...\&" is zero or more color specification characters.
910 You can make
911 .I less
912 think that characters other than "m" can end ANSI color escape sequences
913 by setting the environment variable LESSANSIENDCHARS to the list of
914 characters which can end a color escape sequence.
915 And you can make
916 .I less
917 think that characters other than the standard ones may appear between
918 the ESC and the m by setting the environment variable LESSANSIMIDCHARS
919 to the list of characters which can appear.
920 .IP "\-s or \-\-squeeze-blank-lines"
921 Causes consecutive blank lines to be squeezed into a single blank line.
922 This is useful when viewing
923 .I nroff
924 output.
925 .IP "\-S or \-\-chop-long-lines"
926 Causes lines longer than the screen width to be
927 chopped (truncated) rather than wrapped.
928 That is, the portion of a long line that does not fit in
929 the screen width is not displayed until you press RIGHT-ARROW.
930 The default is to wrap long lines; that is, display the remainder
931 on the next line.
932 .IP "\-t\fItag\fP or \-\-tag=\fItag\fP"
933 The \-t option, followed immediately by a TAG,
934 will edit the file containing that tag.
935 For this to work, tag information must be available;
936 for example, there may be a file in the current directory called "tags",
937 which was previously built by
938 .IR ctags (1)
939 or an equivalent command.
940 If the environment variable LESSGLOBALTAGS is set, it is taken to be
941 the name of a command compatible with
942 .IR global (1),
943 and that command is executed to find the tag.
944 (See 
945 .nh
946 http://www.gnu.org/software/global/global.html).
947 .hy
948 The \-t option may also be specified from within
949 .I less
950 (using the \- command) as a way of examining a new file.
951 The command ":t" is equivalent to specifying \-t from within
952 .IR less .
953 .IP "\-T\fItagsfile\fP or \-\-tag-file=\fItagsfile\fP"
954 Specifies a tags file to be used instead of "tags".
955 .IP "\-u or \-\-underline-special"
956 Causes backspaces and carriage returns to be treated as printable characters;
957 that is, they are sent to the terminal when they appear in the input.
958 .IP "\-U or \-\-UNDERLINE-SPECIAL"
959 Causes backspaces, tabs, carriage returns and "formatting characters"
960 (as defined by Unicode) to be treated as control characters;
961 that is, they are handled as specified by the \-r option.
962 .sp
963 By default, if neither \-u nor \-U is given,
964 backspaces which appear adjacent to an underscore character
965 are treated specially:
966 the underlined text is displayed
967 using the terminal's hardware underlining capability.
968 Also, backspaces which appear between two identical characters
969 are treated specially:
970 the overstruck text is printed
971 using the terminal's hardware boldface capability.
972 Other backspaces are deleted, along with the preceding character.
973 Carriage returns immediately followed by a newline are deleted.
974 Other carriage returns are handled as specified by the \-r option.
975 Unicode formatting characters, such as the Byte Order Mark,
976 are sent to the terminal.
977 Text which is overstruck or underlined can be searched for
978 if neither \-u nor \-U is in effect.
979 .IP "\-V or \-\-version"
980 Displays the version number of
981 .IR less .
982 .IP "\-w or \-\-hilite-unread"
983 Temporarily highlights the first "new" line after a forward movement
984 of a full page.
985 The first "new" line is the line immediately following the line previously
986 at the bottom of the screen.
987 Also highlights the target line after a g or p command.
988 The highlight is removed at the next command which causes movement.
989 The entire line is highlighted, unless the \-J option is in effect,
990 in which case only the status column is highlighted.
991 .IP "\-W or \-\-HILITE-UNREAD"
992 Like \-w, but temporarily highlights the first new line after any
993 forward movement command larger than one line.
994 .IP "\-x\fIn\fP,...\& or \-\-tabs=\fIn\fP,..."
995 Sets tab stops.
996 If only one \fIn\fP is specified, tab stops are set at multiples of \fIn\fP.
997 If multiple values separated by commas are specified, tab stops
998 are set at those positions, and then continue with the same spacing as the
999 last two.
1000 For example, \fI\-x9,17\fP will set tabs at positions 9, 17, 25, 33, etc.
1001 The default for \fIn\fP is 8.
1002 .IP "\-X or \-\-no-init"
1003 Disables sending the termcap initialization and deinitialization strings
1004 to the terminal.
1005 This is sometimes desirable if the deinitialization string does
1006 something unnecessary, like clearing the screen.
1007 .IP "\-y\fIn\fP or \-\-max-forw-scroll=\fIn\fP"
1008 Specifies a maximum number of lines to scroll forward.
1009 If it is necessary to scroll forward more than \fIn\fP lines,
1010 the screen is repainted instead.
1011 The \-c or \-C option may be used to repaint from the top of
1012 the screen if desired.
1013 By default, any forward movement causes scrolling.
1014 .IP "\-z\fIn\fP or \-\-window=\fIn\fP or \-\fIn\fP"
1015 Changes the default scrolling window size to \fIn\fP lines.
1016 The default is one screenful.
1017 The z and w commands can also be used to change the window size.
1018 The "z" may be omitted for compatibility with some versions of
1019 .IR more .
1020 If the number
1021 .I n
1022 is negative, it indicates
1023 .I n
1024 lines less than the current screen size.
1025 For example, if the screen is 24 lines, \fI\-z\-4\fP sets the
1026 scrolling window to 20 lines.  If the screen is resized to 40 lines,
1027 the scrolling window automatically changes to 36 lines.
1028 .IP "\-\(dq\fIcc\fP\ or\ \-\-quotes=\fIcc\fP"
1029 Changes the filename quoting character.
1030 This may be necessary if you are trying to name a file
1031 which contains both spaces and quote characters.
1032 Followed by a single character, this changes the quote character to that
1033 character.
1034 Filenames containing a space should then be surrounded by that character
1035 rather than by double quotes.
1036 Followed by two characters, changes the open quote to the first character,
1037 and the close quote to the second character.
1038 Filenames containing a space should then be preceded by the open quote
1039 character and followed by the close quote character.
1040 Note that even after the quote characters are changed, this option
1041 remains \-" (a dash followed by a double quote).
1042 .IP "\-~ or \-\-tilde"
1043 Normally lines after end of file are displayed as a single tilde (~).
1044 This option causes lines after end of file to be displayed as blank lines.
1045 .IP "\-# or \-\-shift"
1046 Specifies the default number of positions to scroll horizontally
1047 in the RIGHTARROW and LEFTARROW commands.
1048 If the number specified is zero, it sets the default number of
1049 positions to one half of the screen width.
1050 Alternately, the number may be specified as a fraction of the width
1051 of the screen, starting with a decimal point: \&.5 is half of the
1052 screen width, \&.3 is three tenths of the screen width, and so on.
1053 If the number is specified as a fraction, the actual number of
1054 scroll positions is recalculated if the terminal window is resized,
1055 so that the actual scroll remains at the specified fraction
1056 of the screen width.
1057 .IP "\-\-follow-name"
1058 Normally, if the input file is renamed while an F command is executing,
1059 .I less
1060 will continue to display the contents of the original file despite
1061 its name change.
1062 If \-\-follow-name is specified, during an F command
1063 .I less
1064 will periodically attempt to reopen the file by name.
1065 If the reopen succeeds and the file is a different file from the original
1066 (which means that a new file has been created
1067 with the same name as the original (now renamed) file),
1068 .I less
1069 will display the contents of that new file.
1070 .IP "\-\-incsearch"
1071 Subsequent search commands will be "incremental"; that is,
1072 .I less
1073 will advance to the next line containing the search pattern 
1074 as each character of the pattern is typed in.
1075 .IP "\-\-line-num-width"
1076 Sets the minimum width of the line number field when the \-N option is in effect.
1077 The default is 7 characters.
1078 .IP "\-\-mouse"
1079 Enables mouse input:
1080 scrolling the mouse wheel down moves forward in the file,
1081 scrolling the mouse wheel up moves backwards in the file,
1082 and clicking the mouse sets the "#" mark to the line
1083 where the mouse is clicked.
1084 The number of lines to scroll when the wheel is moved
1085 can be set by the \-\-wheel-lines option.
1086 Mouse input works only on terminals which support X11 mouse reporting,
1087 and on the Windows version of
1088 .IR less .
1089 .IP "\-\-MOUSE"
1090 Like \-\-mouse, except the direction scrolled
1091 on mouse wheel movement is reversed.
1092 .IP "\-\-no-keypad"
1093 Disables sending the keypad initialization and deinitialization strings
1094 to the terminal.
1095 This is sometimes useful if the keypad strings make the numeric
1096 keypad behave in an undesirable manner.
1097 .IP "\-\-no-histdups"
1098 This option changes the behavior so that if a search string or
1099 file name is typed in, and the same string is already in the history list,
1100 the existing copy is removed from the history list before the new one is added.
1101 Thus, a given string will appear only once in the history list.
1102 Normally, a string may appear multiple times.
1103 .IP "\-\-rscroll"
1104 This option changes the character used to mark truncated lines.
1105 It may begin with a two-character attribute indicator like LESSBINFMT does.
1106 If there is no attribute indicator, standout is used.
1107 If set to "\-", truncated lines are not marked.
1108 .IP "\-\-save-marks"
1109 Save marks in the history file, so marks are retained
1110 across different invocations of
1111 .IR less .
1112 .IP "\-\-status-col-width"
1113 Sets the width of the status column when the \-J option is in effect.
1114 The default is 2 characters.
1115 .IP "\-\-use-backslash"
1116 This option changes the interpretations of options which follow this one.
1117 After the \-\-use-backslash option, any backslash in an option string is
1118 removed and the following character is taken literally.
1119 This allows a dollar sign to be included in option strings.
1120 .IP "\-\-use-color"
1121 Enables the colored text in various places.
1122 The -D option can be used to change the colors.
1123 Colored text works only if the terminal supports 
1124 ANSI color escape sequences (as defined in ECMA-48 SGR;
1125 see 
1126 .br
1127 .nh
1128 https://www.ecma-international.org/publications-and-standards/standards/ecma-48).
1129 .hy
1130 .IP "\-\-wheel-lines=\fIn\fP"
1131 Set the number of lines to scroll when the mouse wheel is scrolled
1132 and the \-\-mouse or \-\-MOUSE option is in effect.
1133 The default is 1 line.
1134 .IP \-\-
1135 A command line argument of "\-\-" marks the end of option arguments.
1136 Any arguments following this are interpreted as filenames.
1137 This can be useful when viewing a file whose name begins with a "\-" or "+".
1138 .IP +
1139 If a command line option begins with \fB+\fP,
1140 the remainder of that option is taken to be an initial command to
1141 .IR less .
1142 For example, +G tells
1143 .I less
1144 to start at the end of the file rather than the beginning,
1145 and +/xyz tells it to start at the first occurrence of "xyz" in the file.
1146 As a special case, +<number> acts like +<number>g;
1147 that is, it starts the display at the specified line number
1148 (however, see the caveat under the "g" command above).
1149 If the option starts with ++, the initial command applies to
1150 every file being viewed, not just the first one.
1151 The + command described previously
1152 may also be used to set (or change) an initial command for every file.
1153 .
1154 .SH "LINE EDITING"
1155 When entering a command line at the bottom of the screen
1156 (for example, a filename for the :e command,
1157 or the pattern for a search command),
1158 certain keys can be used to manipulate the command line.
1159 Most commands have an alternate form in [ brackets ] which can be used if
1160 a key does not exist on a particular keyboard.
1161 (Note that the forms beginning with ESC do not work
1162 in some MS-DOS and Windows systems because ESC is the line erase character.)
1163 Any of these special keys may be entered literally by preceding
1164 it with the "literal" character, either ^V or ^A.
1165 A backslash itself may also be entered literally by entering two backslashes.
1166 .IP "LEFTARROW [ ESC-h ]"
1167 Move the cursor one space to the left.
1168 .IP "RIGHTARROW [ ESC-l ]"
1169 Move the cursor one space to the right.
1170 .IP "^LEFTARROW [ ESC-b or ESC-LEFTARROW ]"
1171 (That is, CONTROL and LEFTARROW simultaneously.)
1172 Move the cursor one word to the left.
1173 .IP "^RIGHTARROW [ ESC-w or ESC-RIGHTARROW ]"
1174 (That is, CONTROL and RIGHTARROW simultaneously.)
1175 Move the cursor one word to the right.
1176 .IP "HOME [ ESC-0 ]"
1177 Move the cursor to the beginning of the line.
1178 .IP "END [ ESC-$ ]"
1179 Move the cursor to the end of the line.
1180 .IP "BACKSPACE"
1181 Delete the character to the left of the cursor,
1182 or cancel the command if the command line is empty.
1183 .IP "DELETE or [ ESC-x ]"
1184 Delete the character under the cursor.
1185 .IP "^BACKSPACE [ ESC-BACKSPACE ]"
1186 (That is, CONTROL and BACKSPACE simultaneously.)
1187 Delete the word to the left of the cursor.
1188 .IP "^DELETE [ ESC-X or ESC-DELETE ]"
1189 (That is, CONTROL and DELETE simultaneously.)
1190 Delete the word under the cursor.
1191 .IP "UPARROW [ ESC-k ]"
1192 Retrieve the previous command line.
1193 If you first enter some text and then press UPARROW,
1194 it will retrieve the previous command which begins with that text.
1195 .IP "DOWNARROW [ ESC-j ]"
1196 Retrieve the next command line.
1197 If you first enter some text and then press DOWNARROW,
1198 it will retrieve the next command which begins with that text.
1199 .IP "TAB"
1200 Complete the partial filename to the left of the cursor.
1201 If it matches more than one filename, the first match
1202 is entered into the command line.
1203 Repeated TABs will cycle thru the other matching filenames.
1204 If the completed filename is a directory, a "/" is appended to the filename.
1205 (On MS-DOS systems, a "\e" is appended.)
1206 The environment variable LESSSEPARATOR can be used to specify a
1207 different character to append to a directory name.
1208 .IP "BACKTAB [ ESC-TAB ]"
1209 Like, TAB, but cycles in the reverse direction thru the matching filenames.
1210 .IP "^L"
1211 Complete the partial filename to the left of the cursor.
1212 If it matches more than one filename, all matches are entered into
1213 the command line (if they fit).
1214 .IP "^U (Unix and OS/2) or ESC (MS-DOS)"
1215 Delete the entire command line,
1216 or cancel the command if the command line is empty.
1217 If you have changed your line-kill character in Unix to something
1218 other than ^U, that character is used instead of ^U.
1219 .IP "^G"
1220 Delete the entire command line and return to the main prompt.
1221 .
1222 .SH "KEY BINDINGS"
1223 You may define your own
1224 .I less
1225 commands by using the program
1226 .IR lesskey (1)
1227 to create a lesskey file.
1228 This file specifies a set of command keys and an action
1229 associated with each key.
1230 You may also use
1231 .I lesskey
1232 to change the line-editing keys (see LINE EDITING),
1233 and to set environment variables.
1234 If the environment variable LESSKEY is set,
1235 .I less
1236 uses that as the name of the lesskey file.
1237 Otherwise,
1238 .I less
1239 looks in a standard place for the lesskey file:
1240 On Unix systems,
1241 .I less
1242 looks for a lesskey file called "$HOME/.less".
1243 On MS-DOS and Windows systems,
1244 .I less
1245 looks for a lesskey file called "$HOME/_less", and if it is not found there,
1246 then looks for a lesskey file called "_less" in any directory specified
1247 in the PATH environment variable.
1248 On OS/2 systems,
1249 .I less
1250 looks for a lesskey file called "$HOME/less.ini", and if it is not found,
1251 then looks for a lesskey file called "less.ini" in any directory specified
1252 in the INIT environment variable, and if it not found there,
1253 then looks for a lesskey file called "less.ini" in any directory specified
1254 in the PATH environment variable.
1255 See the
1256 .I lesskey
1257 manual page for more details.
1258 .P
1259 A system-wide lesskey file may also be set up to provide key bindings.
1260 If a key is defined in both a local lesskey file and in the
1261 system-wide file, key bindings in the local file take precedence over
1262 those in the system-wide file.
1263 If the environment variable LESSKEY_SYSTEM is set,
1264 .I less
1265 uses that as the name of the system-wide lesskey file.
1266 Otherwise,
1267 .I less
1268 looks in a standard place for the system-wide lesskey file:
1269 On Unix systems, the system-wide lesskey file is /usr/local/etc/sysless.
1270 (However, if
1271 .I less
1272 was built with a different sysconf directory than /usr/local/etc,
1273 that directory is where the sysless file is found.)
1274 On MS-DOS and Windows systems, the system-wide lesskey file is c:\e_sysless.
1275 On OS/2 systems, the system-wide lesskey file is c:\esysless.ini.
1276 .
1277 .SH "INPUT PREPROCESSOR"
1278 You may define an "input preprocessor" for
1279 .IR less .
1280 Before
1281 .I less
1282 opens a file, it first gives your input preprocessor a chance to modify the
1283 way the contents of the file are displayed.
1284 An input preprocessor is simply an executable program (or shell script),
1285 which writes the contents of the file to a different file,
1286 called the replacement file.
1287 The contents of the replacement file are then displayed
1288 in place of the contents of the original file.
1289 However, it will appear to the user as if the original file is opened;
1290 that is,
1291 .I less
1292 will display the original filename as the name of the current file.
1293 .PP
1294 An input preprocessor receives one command line argument, the original filename,
1295 as entered by the user.
1296 It should create the replacement file, and when finished,
1297 print the name of the replacement file to its standard output.
1298 If the input preprocessor does not output a replacement filename,
1299 .I less
1300 uses the original file, as normal.
1301 The input preprocessor is not called when viewing standard input.
1302 To set up an input preprocessor, set the LESSOPEN environment variable
1303 to a command line which will invoke your input preprocessor.
1304 This command line should include one occurrence of the string "%s",
1305 which will be replaced by the filename
1306 when the input preprocessor command is invoked.
1307 .PP
1308 When
1309 .I less
1310 closes a file opened in such a way, it will call another program,
1311 called the input postprocessor,
1312 which may perform any desired clean-up action (such as deleting the
1313 replacement file created by LESSOPEN).
1314 This program receives two command line arguments, the original filename
1315 as entered by the user, and the name of the replacement file.
1316 To set up an input postprocessor, set the LESSCLOSE environment variable
1317 to a command line which will invoke your input postprocessor.
1318 It may include two occurrences of the string "%s";
1319 the first is replaced with the original name of the file and
1320 the second with the name of the replacement file,
1321 which was output by LESSOPEN.
1322 .PP
1323 For example, on many Unix systems, these two scripts will allow you
1324 to keep files in compressed format, but still let
1325 .I less
1326 view them directly:
1327 .PP
1328 lessopen.sh:
1329 .br
1330         #! /bin/sh
1331 .br
1332         case "$1" in
1333 .br
1334         *.Z)    TEMPFILE=$(mktemp)
1335 .br
1336                 uncompress \-c $1  >$TEMPFILE  2>/dev/null
1337 .br
1338                 if [ \-s $TEMPFILE ]; then
1339 .br
1340                         echo $TEMPFILE
1341 .br
1342                 else
1343 .br
1344                         rm \-f $TEMPFILE
1345 .br
1346                 fi
1347 .br
1348                 ;;
1349 .br
1350         esac
1351 .PP
1352 lessclose.sh:
1353 .br
1354         #! /bin/sh
1355 .br
1356         rm $2
1357 .PP
1358 To use these scripts, put them both where they can be executed and
1359 set LESSOPEN="lessopen.sh\ %s", and
1360 LESSCLOSE="lessclose.sh\ %s\ %s".
1361 More complex LESSOPEN and LESSCLOSE scripts may be written
1362 to accept other types of compressed files, and so on.
1363 .PP
1364 It is also possible to set up an input preprocessor to
1365 pipe the file data directly to
1366 .IR less ,
1367 rather than putting the data into a replacement file.
1368 This avoids the need to decompress the entire file before
1369 starting to view it.
1370 An input preprocessor that works this way is called an input pipe.
1371 An input pipe, instead of writing the name of a replacement file on
1372 its standard output,
1373 writes the entire contents of the replacement file on its standard output.
1374 If the input pipe does not write any characters on its standard output,
1375 then there is no replacement file and
1376 .I less
1377 uses the original file, as normal.
1378 To use an input pipe,
1379 make the first character in the LESSOPEN environment variable a
1380 vertical bar (|) to signify that the input preprocessor is an input pipe.
1381 As with non-pipe input preprocessors, the command string must contain one
1382 occurrence of %s, which is replaced with the filename of the input file.
1383 .PP
1384 For example, on many Unix systems, this script will work like the
1385 previous example scripts:
1386 .PP
1387 lesspipe.sh:
1388 .br
1389         #! /bin/sh
1390 .br
1391         case "$1" in
1392 .br
1393         *.Z)    uncompress \-c $1  2>/dev/null
1394 .br
1395                 ;;
1396 .br
1397         *)      exit 1
1398 .br
1399                 ;;
1400 .br
1401         esac
1402 .br
1403         exit $?
1404 .br
1405 .PP
1406 To use this script, put it where it can be executed and set
1407 LESSOPEN="|lesspipe.sh %s".
1408 .PP
1409 Note that a preprocessor cannot output an empty file, since that
1410 is interpreted as meaning there is no replacement, and
1411 the original file is used.
1412 To avoid this, if LESSOPEN starts with two vertical bars,
1413 the exit status of the script becomes meaningful.
1414 If the exit status is zero, the output is considered to be
1415 replacement text, even if it is empty.
1416 If the exit status is nonzero, any output is ignored and the
1417 original file is used.
1418 For compatibility with previous versions of
1419 .IR less ,
1420 if LESSOPEN starts with only one vertical bar, the exit status
1421 of the preprocessor is ignored.
1422 .PP
1423 When an input pipe is used, a LESSCLOSE postprocessor can be used,
1424 but it is usually not necessary since there is no replacement file
1425 to clean up.
1426 In this case, the replacement file name passed to the LESSCLOSE
1427 postprocessor is "\-".
1428 .PP
1429 For compatibility with previous versions of
1430 .IR less ,
1431 the input preprocessor or pipe is not used if
1432 .I less
1433 is viewing standard input.
1434 However, if the first character of LESSOPEN is a dash (\-),
1435 the input preprocessor is used on standard input as well as other files.
1436 In this case, the dash is not considered to be part of
1437 the preprocessor command.
1438 If standard input is being viewed, the input preprocessor is passed
1439 a file name consisting of a single dash.
1440 Similarly, if the first two characters of LESSOPEN are vertical bar and dash
1441 (|\-) or two vertical bars and a dash (||\-),
1442 the input pipe is used on standard input as well as other files.
1443 Again, in this case the dash is not considered to be part of
1444 the input pipe command.
1445 .
1446 .SH "NATIONAL CHARACTER SETS"
1447 There are three types of characters in the input file:
1448 .IP "normal characters"
1449 can be displayed directly to the screen.
1450 .IP "control characters"
1451 should not be displayed directly, but are expected to be found
1452 in ordinary text files (such as backspace and tab).
1453 .IP "binary characters"
1454 should not be displayed directly and are not expected to be found
1455 in text files.
1456 .PP
1457 A "character set" is simply a description of which characters are to
1458 be considered normal, control, and binary.
1459 The LESSCHARSET environment variable may be used to select a character set.
1460 Possible values for LESSCHARSET are:
1461 .IP ascii
1462 BS, TAB, NL, CR, and formfeed are control characters,
1463 all chars with values between 32 and 126 are normal,
1464 and all others are binary.
1465 .IP iso8859
1466 Selects an ISO 8859 character set.
1467 This is the same as ASCII, except characters between 160 and 255 are
1468 treated as normal characters.
1469 .IP latin1
1470 Same as iso8859.
1471 .IP latin9
1472 Same as iso8859.
1473 .IP dos
1474 Selects a character set appropriate for MS-DOS.
1475 .IP ebcdic
1476 Selects an EBCDIC character set.
1477 .IP IBM-1047
1478 Selects an EBCDIC character set used by OS/390 Unix Services.
1479 This is the EBCDIC analogue of latin1.  You get similar results
1480 by setting either LESSCHARSET=IBM-1047 or LC_CTYPE=en_US
1481 in your environment.
1482 .IP koi8-r
1483 Selects a Russian character set.
1484 .IP next
1485 Selects a character set appropriate for NeXT computers.
1486 .IP utf-8
1487 Selects the UTF-8 encoding of the ISO 10646 character set.
1488 UTF-8 is special in that it supports multi-byte characters in the input file.
1489 It is the only character set that supports multi-byte characters.
1490 .IP windows
1491 Selects a character set appropriate for Microsoft Windows (cp 1251).
1492 .PP
1493 In rare cases, it may be desired to tailor
1494 .I less
1495 to use a character set other than the ones definable by LESSCHARSET.
1496 In this case, the environment variable LESSCHARDEF can be used
1497 to define a character set.
1498 It should be set to a string where each character in the string represents
1499 one character in the character set.
1500 The character ".\&" is used for a normal character, "c" for control,
1501 and "b" for binary.
1502 A decimal number may be used for repetition.
1503 For example, "bccc4b.\&" would mean character 0 is binary,
1504 1, 2 and 3 are control, 4, 5, 6 and 7 are binary, and 8 is normal.
1505 All characters after the last are taken to be the same as the last,
1506 so characters 9 through 255 would be normal.
1507 (This is an example, and does not necessarily
1508 represent any real character set.)
1509 .PP
1510 This table shows the value of LESSCHARDEF which is equivalent
1511 to each of the possible values for LESSCHARSET:
1512 .
1513 .RS 5m
1514 .TS
1515 l l.
1516 ascii   8bcccbcc18b95.b
1517 dos     8bcccbcc12bc5b95.b.
1518 ebcdic  5bc6bcc7bcc41b.9b7.9b5.b..8b6.10b6.b9.7b
1519         9.8b8.17b3.3b9.7b9.8b8.6b10.b.b.b.
1520 IBM-1047        4cbcbc3b9cbccbccbb4c6bcc5b3cbbc4bc4bccbc
1521         191.b
1522 iso8859 8bcccbcc18b95.33b.
1523 koi8-r  8bcccbcc18b95.b128.
1524 latin1  8bcccbcc18b95.33b.
1525 next    8bcccbcc18b95.bb125.bb
1526 .TE
1527 .RE
1528 .PP
1529 If neither LESSCHARSET nor LESSCHARDEF is set,
1530 but any of the strings "UTF-8", "UTF8", "utf-8" or "utf8"
1531 is found in the LC_ALL, LC_CTYPE or LANG
1532 environment variables, then the default character set is utf-8.
1533 .PP
1534 If that string is not found, but your system supports the
1535 .I setlocale
1536 interface,
1537 .I less
1538 will use setlocale to determine the character set.
1539 setlocale is controlled by setting the LANG or LC_CTYPE environment
1540 variables.
1541 .PP
1542 Finally, if the
1543 .I setlocale
1544 interface is also not available, the default character set is latin1.
1545 .PP
1546 Control and binary characters are displayed in standout (reverse video).
1547 Each such character is displayed in caret notation if possible
1548 (e.g.\& ^A for control-A).  Caret notation is used only if
1549 inverting the 0100 bit results in a normal printable character.
1550 Otherwise, the character is displayed as a hex number in angle brackets.
1551 This format can be changed by
1552 setting the LESSBINFMT environment variable.
1553 LESSBINFMT may begin with a "*" and one character to select
1554 the display attribute:
1555 "*k" is blinking, "*d" is bold, "*u" is underlined, "*s" is standout,
1556 and "*n" is normal.
1557 If LESSBINFMT does not begin with a "*", normal attribute is assumed.
1558 The remainder of LESSBINFMT is a string which may include one
1559 printf-style escape sequence (a % followed by x, X, o, d, etc.).
1560 For example, if LESSBINFMT is "*u[%x]", binary characters
1561 are displayed in underlined hexadecimal surrounded by brackets.
1562 The default if no LESSBINFMT is specified is "*s<%02X>".
1563 Warning: the result of expanding the character via LESSBINFMT must
1564 be less than 31 characters.
1565 .PP
1566 When the character set is utf-8, the LESSUTFBINFMT environment variable
1567 acts similarly to LESSBINFMT but it applies to Unicode code points
1568 that were successfully decoded but are unsuitable for display (e.g.,
1569 unassigned code points).
1570 Its default value is "<U+%04lX>".
1571 Note that LESSUTFBINFMT and LESSBINFMT share their display attribute
1572 setting ("*x") so specifying one will affect both;
1573 LESSUTFBINFMT is read after LESSBINFMT so its setting, if any,
1574 will have priority.
1575 Problematic octets in a UTF-8 file (octets of a truncated sequence,
1576 octets of a complete but non-shortest form sequence, invalid octets,
1577 and stray trailing octets)
1578 are displayed individually using LESSBINFMT so as to facilitate diagnostic
1579 of how the UTF-8 file is ill-formed.
1580 .
1581 .SH "PROMPTS"
1582 The \-P option allows you to tailor the prompt to your preference.
1583 The string given to the \-P option replaces the specified prompt string.
1584 Certain characters in the string are interpreted specially.
1585 The prompt mechanism is rather complicated to provide flexibility,
1586 but the ordinary user need not understand the details of constructing
1587 personalized prompt strings.
1588 .sp
1589 A percent sign followed by a single character is expanded
1590 according to what the following character is:
1591 .IP "%b\fIX\fP"
1592 Replaced by the byte offset into the current input file.
1593 The b is followed by a single character (shown as \fIX\fP above)
1594 which specifies the line whose byte offset is to be used.
1595 If the character is a "t", the byte offset of the top line in the
1596 display is used,
1597 an "m" means use the middle line,
1598 a "b" means use the bottom line,
1599 a "B" means use the line just after the bottom line,
1600 and a "j" means use the "target" line, as specified by the \-j option.
1601 .IP "%B"
1602 Replaced by the size of the current input file.
1603 .IP "%c"
1604 Replaced by the column number of the text appearing in the first
1605 column of the screen.
1606 .IP "%d\fIX\fP"
1607 Replaced by the page number of a line in the input file.
1608 The line to be used is determined by the \fIX\fP, as with the %b option.
1609 .IP "%D"
1610 Replaced by the number of pages in the input file,
1611 or equivalently, the page number of the last line in the input file.
1612 .IP "%E"
1613 Replaced by the name of the editor (from the VISUAL environment variable,
1614 or the EDITOR environment variable if VISUAL is not defined).
1615 See the discussion of the LESSEDIT feature below.
1616 .IP "%f"
1617 Replaced by the name of the current input file.
1618 .IP "%F"
1619 Replaced by the last component of the name of the current input file.
1620 .IP "%g"
1621 Replaced by the shell-escaped name of the current input file.
1622 This is useful when the expanded string will be used in a shell command,
1623 such as in LESSEDIT.
1624 .IP "%i"
1625 Replaced by the index of the current file in the list of
1626 input files.
1627 .IP "%l\fIX\fP"
1628 Replaced by the line number of a line in the input file.
1629 The line to be used is determined by the \fIX\fP, as with the %b option.
1630 .IP "%L"
1631 Replaced by the line number of the last line in the input file.
1632 .IP "%m"
1633 Replaced by the total number of input files.
1634 .IP "%p\fIX\fP"
1635 Replaced by the percent into the current input file, based on byte offsets.
1636 The line used is determined by the \fIX\fP as with the %b option.
1637 .IP "%P\fIX\fP"
1638 Replaced by the percent into the current input file, based on line numbers.
1639 The line used is determined by the \fIX\fP as with the %b option.
1640 .IP "%s"
1641 Same as %B.
1642 .IP "%t"
1643 Causes any trailing spaces to be removed.
1644 Usually used at the end of the string, but may appear anywhere.
1645 .IP "%T"
1646 Normally expands to the word "file".
1647 However if viewing files via a tags list using the \-t option,
1648 it expands to the word "tag".
1649 .IP "%x"
1650 Replaced by the name of the next input file in the list.
1651 .PP
1652 If any item is unknown (for example, the file size if input
1653 is a pipe), a question mark is printed instead.
1654 .PP
1655 The format of the prompt string can be changed
1656 depending on certain conditions.
1657 A question mark followed by a single character acts like an "IF":
1658 depending on the following character, a condition is evaluated.
1659 If the condition is true, any characters following the question mark
1660 and condition character, up to a period, are included in the prompt.
1661 If the condition is false, such characters are not included.
1662 A colon appearing between the question mark and the
1663 period can be used to establish an "ELSE": any characters between
1664 the colon and the period are included in the string if and only if
1665 the IF condition is false.
1666 Condition characters (which follow a question mark) may be:
1667 .IP "?a"
1668 True if any characters have been included in the prompt so far.
1669 .IP "?b\fIX\fP"
1670 True if the byte offset of the specified line is known.
1671 .IP "?B"
1672 True if the size of current input file is known.
1673 .IP "?c"
1674 True if the text is horizontally shifted (%c is not zero).
1675 .IP "?d\fIX\fP"
1676 True if the page number of the specified line is known.
1677 .IP "?e"
1678 True if at end-of-file.
1679 .IP "?f"
1680 True if there is an input filename
1681 (that is, if input is not a pipe).
1682 .IP "?l\fIX\fP"
1683 True if the line number of the specified line is known.
1684 .IP "?L"
1685 True if the line number of the last line in the file is known.
1686 .IP "?m"
1687 True if there is more than one input file.
1688 .IP "?n"
1689 True if this is the first prompt in a new input file.
1690 .IP "?p\fIX\fP"
1691 True if the percent into the current input file, based on byte offsets,
1692 of the specified line is known.
1693 .IP "?P\fIX\fP"
1694 True if the percent into the current input file, based on line numbers,
1695 of the specified line is known.
1696 .IP "?s"
1697 Same as "?B".
1698 .IP "?x"
1699 True if there is a next input file
1700 (that is, if the current input file is not the last one).
1701 .PP
1702 Any characters other than the special ones
1703 (question mark, colon, period, percent, and backslash)
1704 become literally part of the prompt.
1705 Any of the special characters may be included in the prompt literally
1706 by preceding it with a backslash.
1707 .PP
1708 Some examples:
1709 .sp
1710 ?f%f:Standard input.
1711 .sp
1712 This prompt prints the filename, if known;
1713 otherwise the string "Standard input".
1714 .sp
1715 ?f%f \&.?ltLine %lt:?pt%pt\e%:?btByte %bt:-...
1716 .sp
1717 This prompt would print the filename, if known.
1718 The filename is followed by the line number, if known,
1719 otherwise the percent if known, otherwise the byte offset if known.
1720 Otherwise, a dash is printed.
1721 Notice how each question mark has a matching period,
1722 and how the % after the %pt
1723 is included literally by escaping it with a backslash.
1724 .sp
1725 ?n?f%f\ .?m(%T %i of %m)\ ..?e(END)\ ?x-\ Next\e:\ %x..%t";
1726 .sp
1727 This prints the filename if this is the first prompt in a file,
1728 followed by the "file N of N" message if there is more
1729 than one input file.
1730 Then, if we are at end-of-file, the string "(END)" is printed
1731 followed by the name of the next file, if there is one.
1732 Finally, any trailing spaces are truncated.
1733 This is the default prompt.
1734 For reference, here are the defaults for
1735 the other two prompts (\-m and \-M respectively).
1736 Each is broken into two lines here for readability only.
1737 .nf
1738 .sp
1739 ?n?f%f\ .?m(%T\ %i\ of\ %m)\ ..?e(END)\ ?x-\ Next\e:\ %x.:
1740         ?pB%pB\e%:byte\ %bB?s/%s...%t
1741 .sp
1742 ?f%f\ .?n?m(%T\ %i\ of\ %m)\ ..?ltlines\ %lt-%lb?L/%L.\ :
1743         byte\ %bB?s/%s.\ .?e(END)\ ?x-\ Next\e:\ %x.:?pB%pB\e%..%t
1744 .sp
1745 .fi
1746 And here is the default message produced by the = command:
1747 .nf
1748 .sp
1749 ?f%f\ .?m(%T\ %i\ of\ %m)\ .?ltlines\ %lt-%lb?L/%L.\ .
1750         byte\ %bB?s/%s.\ ?e(END)\ :?pB%pB\e%..%t
1751 .fi
1752 .PP
1753 The prompt expansion features are also used for another purpose:
1754 if an environment variable LESSEDIT is defined, it is used
1755 as the command to be executed when the v command is invoked.
1756 The LESSEDIT string is expanded in the same way as the prompt strings.
1757 The default value for LESSEDIT is:
1758 .nf
1759 .sp
1760         %E\ ?lm+%lm.\ %g
1761 .sp
1762 .fi
1763 Note that this expands to the editor name, followed by a + and the
1764 line number, followed by the shell-escaped file name.
1765 If your editor does not accept the "+linenumber" syntax, or has other
1766 differences in invocation syntax, the LESSEDIT variable can be
1767 changed to modify this default.
1768 .
1769 .SH SECURITY
1770 When the environment variable LESSSECURE is set to 1,
1771 .I less
1772 runs in a "secure" mode.
1773 This means these features are disabled:
1774 .RS
1775 .IP "!"
1776 the shell command
1777 .IP "|"
1778 the pipe command
1779 .IP ":e"
1780 the examine command.
1781 .IP "v"
1782 the editing command
1783 .IP "s  \-o"
1784 log files
1785 .IP "\-k"
1786 use of lesskey files
1787 .IP "\-t"
1788 use of tags files
1789 .IP
1790 metacharacters in filenames, such as *
1791 .IP
1792 filename completion (TAB, ^L)
1793 .RE
1794 .PP
1795 Less can also be compiled to be permanently in "secure" mode.
1796 .
1797 .SH "COMPATIBILITY WITH MORE"
1798 If the environment variable LESS_IS_MORE is set to 1,
1799 or if the program is invoked via a file link named "more",
1800 .I less
1801 behaves (mostly) in conformance with the POSIX "more" command specification.
1802 In this mode, less behaves differently in these ways:
1803 .PP
1804 The \-e option works differently.
1805 If the \-e option is not set,
1806 .I less
1807 behaves as if the \-e option were set.
1808 If the \-e option is set,
1809 .I less
1810 behaves as if the \-E option were set.
1811 .PP
1812 The \-m option works differently.
1813 If the \-m option is not set, the medium prompt is used,
1814 and it is prefixed with the string "\-\-More\-\-".
1815 If the \-m option is set, the short prompt is used.
1816 .PP
1817 The \-n option acts like the \-z option.
1818 The normal behavior of the \-n option is unavailable in this mode.
1819 .PP
1820 The parameter to the \-p option is taken to be a
1821 .I less
1822 command rather than a search pattern.
1823 .PP
1824 The LESS environment variable is ignored,
1825 and the MORE environment variable is used in its place.
1826 .
1827 .SH "ENVIRONMENT VARIABLES"
1828 Environment variables may be specified either in the system environment
1829 as usual, or in a
1830 .IR lesskey (1)
1831 file.
1832 If environment variables are defined in more than one place,
1833 variables defined in a local lesskey file take precedence over
1834 variables defined in the system environment, which take precedence
1835 over variables defined in the system-wide lesskey file.
1836 .IP COLUMNS
1837 Sets the number of columns on the screen.
1838 Takes precedence over the number of columns specified by the TERM variable.
1839 (But if you have a windowing system which supports TIOCGWINSZ or WIOCGETD,
1840 the window system's idea of the screen size takes precedence over the
1841 LINES and COLUMNS environment variables.)
1842 .IP EDITOR
1843 The name of the editor (used for the v command).
1844 .IP HOME
1845 Name of the user's home directory
1846 (used to find a lesskey file on Unix and OS/2 systems).
1847 .IP "HOMEDRIVE, HOMEPATH"
1848 Concatenation of the HOMEDRIVE and HOMEPATH environment variables is
1849 the name of the user's home directory if the HOME variable is not set
1850 (only in the Windows version).
1851 .IP INIT
1852 Name of the user's init directory (used to find a lesskey file on OS/2 systems).
1853 .IP LANG
1854 Language for determining the character set.
1855 .IP LC_CTYPE
1856 Language for determining the character set.
1857 .IP LESS
1858 Options which are passed to
1859 .I less
1860 automatically.
1861 .IP LESSANSIENDCHARS
1862 Characters which may end an ANSI color escape sequence
1863 (default "m").
1864 .IP LESSANSIMIDCHARS
1865 Characters which may appear between the ESC character and the
1866 end character in an ANSI color escape sequence
1867 (default "0123456789:;[?!"'#%()*+\ ".
1868 .IP LESSBINFMT
1869 Format for displaying non-printable, non-control characters.
1870 .IP LESSCHARDEF
1871 Defines a character set.
1872 .IP LESSCHARSET
1873 Selects a predefined character set.
1874 .IP LESSCLOSE
1875 Command line to invoke the (optional) input-postprocessor.
1876 .IP LESSECHO
1877 Name of the lessecho program (default "lessecho").
1878 The lessecho program is needed to expand metacharacters, such as * and ?,
1879 in filenames on Unix systems.
1880 .IP LESSEDIT
1881 Editor prototype string (used for the v command).
1882 See discussion under PROMPTS.
1883 .IP LESSGLOBALTAGS
1884 Name of the command used by the \-t option to find global tags.
1885 Normally should be set to "global" if your system has the
1886 .IR global (1)
1887 command.  If not set, global tags are not used.
1888 .IP LESSHISTFILE
1889 Name of the history file used to remember search commands and
1890 shell commands between invocations of
1891 .IR less .
1892 If set to "\-" or "/dev/null", a history file is not used.
1893 The default is "$HOME/.lesshst" on Unix systems, "$HOME/_lesshst" on
1894 DOS and Windows systems, or "$HOME/lesshst.ini" or "$INIT/lesshst.ini"
1895 on OS/2 systems.
1896 .IP LESSHISTSIZE
1897 The maximum number of commands to save in the history file.
1898 The default is 100.
1899 .IP LESSKEY
1900 Name of the default
1901 .IR lesskey (1)
1902 file.
1903 .IP LESSKEY_SYSTEM
1904 Name of the default system-wide
1905 .IR lesskey (1)
1906 file.
1907 .IP LESSMETACHARS
1908 List of characters which are considered "metacharacters" by the shell.
1909 .IP LESSMETAESCAPE
1910 Prefix which less will add before each metacharacter in a
1911 command sent to the shell.
1912 If LESSMETAESCAPE is an empty string, commands containing
1913 metacharacters will not be passed to the shell.
1914 .IP LESSOPEN
1915 Command line to invoke the (optional) input-preprocessor.
1916 .IP LESSSECURE
1917 Runs less in "secure" mode.
1918 See discussion under SECURITY.
1919 .IP LESSSEPARATOR
1920 String to be appended to a directory name in filename completion.
1921 .IP LESSUTFBINFMT
1922 Format for displaying non-printable Unicode code points.
1923 .IP LESS_IS_MORE
1924 Emulate the
1925 .IR more (1)
1926 command.
1927 .IP LINES
1928 Sets the number of lines on the screen.
1929 Takes precedence over the number of lines specified by the TERM variable.
1930 (But if you have a windowing system which supports TIOCGWINSZ or WIOCGETD,
1931 the window system's idea of the screen size takes precedence over the
1932 LINES and COLUMNS environment variables.)
1933 .IP MORE
1934 Options which are passed to
1935 .I less
1936 automatically when running in
1937 .I more
1938 compatible mode.
1939 .IP PATH
1940 User's search path (used to find a lesskey file
1941 on MS-DOS and OS/2 systems).
1942 .IP SHELL
1943 The shell used to execute the !\& command, as well as to expand filenames.
1944 .IP TERM
1945 The type of terminal on which
1946 .I less
1947 is being run.
1948 .IP VISUAL
1949 The name of the editor (used for the v command).
1950 .
1951 .SH "SEE ALSO"
1952 .BR lesskey (1)
1953 .
1954 .SH COPYRIGHT
1955 Copyright (C) 1984-2021  Mark Nudelman
1956 .PP
1957 less is part of the GNU project and is free software.
1958 You can redistribute it and/or modify it
1959 under the terms of either
1960 (1) the GNU General Public License as published by
1961 the Free Software Foundation; or (2) the Less License.
1962 See the file README in the less distribution for more details
1963 regarding redistribution.
1964 You should have received a copy of the GNU General Public License
1965 along with the source for less; see the file COPYING.
1966 If not, write to the Free Software Foundation, 59 Temple Place,
1967 Suite 330, Boston, MA  02111-1307, USA.
1968 You should also have received a copy of the Less License;
1969 see the file LICENSE.
1970 .PP
1971 less is distributed in the hope that it will be useful, but
1972 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
1973 or FITNESS FOR A PARTICULAR PURPOSE.
1974 See the GNU General Public License for more details.
1975 .
1976 .SH AUTHOR
1977 .
1978 Mark Nudelman
1979 .br
1980 Report bugs at https://github.com/gwsw/less/issues.
1981 .br
1982 For more information, see the less homepage at
1983 .br
1984 https://greenwoodsoftware.com/less.