Debian Codegraph @

upstream/fedora-44/man1/less.1

raw
1 '\" t
2 .TH LESS 1 "10 Jan 2026" "less 691"
3 .\" Define a string for the caret ("hat") as portably as possible.
4 .ie \n(.g .ds ^ \(ha
5 .el .ds ^ ^
6 .\" Define a string for the tilde as portably as possible.
7 .ie \n(.g .ds ~ \(ti
8 .el .ds ~ ~
9 .\" Define a string for the neutral apostrophe as portably as possible.
10 .ie \n(.g .ds ' \(aq
11 .el .ds ' '
12 .\" Define a string to interpolate the hyphenless break point escape
13 .\" sequence (for URLs and similar) if the formatter claims groff
14 .\" compatibility, else interpolate nothing.
15 .ie \n(.g .ds : \:
16 .el .ds : \" empty
17 .SH NAME
18 less \- display the contents of a file in a terminal
19 .SH SYNOPSIS
20 .HP
21 .nr sA \n(.j \" Save the adjustment mode.
22 .na
23 .B less
24 .\" AT&T man(7) macros accept six arguments at most.
25 .RB [ \- [ + ] aABcCdeEfFgGiIJKLmMnNqQrRsSuUVwWX\*~\c
26 ]
27 .RB [ \-b\ \c
28 .IR size ]
29 .RB [ \-D\ \c
30 .IR color ]
31 .RB [ \-h\ \c
32 .IR lines ]
33 .RB [ \-j\ \c
34 .IR line ]
35 .RB [ \-k\ \c
36 .IR key-file ]
37 .RB [ \- { o | O\c
38 }
39 .IR log-file ]
40 .RB [ \-p\ \c
41 .I pattern ]
42 .RB [ \-P\ \c
43 .IR prompt ]
44 .RB [ \-t\ \c
45 .IR tag ]
46 .RB [ \-T\ \c
47 .IR tags-file ]
48 .RB [ \-x\ \c
49 .IR tab [{\c
50 .BI , tab\c
51 }.\|.\|.]]\&
52 .RB [ \-y\ \c
53 .IR lines ]
54 .RB [ \-z\ \c
55 .IR lines ]
56 .RB [ \-\c
57 .IR lines ]
58 .\" Work around bugs in the man(7) font selection macros in Solaris 10,
59 .\" Plan 9, and DWB 3.3 troffs.
60 .\".RB [ "\-\[dq]\c"\" works with groff, mandoc, and Heirloom Doctools
61 [\fB\-"\c
62 .IR cc ]
63 .RB [ \-#\ \c
64 .IR shift ]
65 .RB [ +\c
66 .IR less-command ]
67 .RB [ \-\- ]
68 .RI [ file \ .\|.\|.]
69 .ad \n(sA \" Restore the adjustment mode.
70 .PP
71 .B "less \-?"
72 .br
73 .B "less \-\-help"
74 .PP
75 .B "less \-V"
76 .br
77 .B "less \-\-version"
78 .PP
79 (See the OPTIONS section for alternate option syntax with long option names.)
80 .
81 .SH DESCRIPTION
82 .B Less
83 is a program similar to
84 .BR more (1),
85 but it has many more features.
86 .B Less
87 does not have to read the entire input file before starting,
88 so with large input files it starts up faster than text editors like
89 .BR vi (1).
90 .B Less
91 uses termcap (or terminfo on some systems),
92 so it can run on a variety of terminals.
93 There is even limited support for hardcopy terminals.
94 (On a hardcopy terminal, lines which should be printed at the top
95 of the screen are prefixed with a caret.)
96 .SH COMMANDS
97 Commands are based on both
98 .B more
99 and
100 .BR vi .
101 Commands may be preceded by a decimal number,
102 called N in the descriptions below.
103 The number is used by some commands, as indicated.
104 .PP
105 In the following descriptions, \*^X means control-X.
106 ESC stands for the ESCAPE key; for example ESC-v means the
107 two character sequence "ESCAPE", then "v".
108 .IP "h or H"
109 Help: display a summary of these commands.
110 If you forget all the other commands, remember this one.
111 .IP "SPACE or \*^V or f or \*^F"
112 Scroll forward N lines, default one window (see option
113 .B \-z
114 below).
115 If N is more than the screen size, only the final screenful is displayed.
116 Warning: some systems use \*^V as a special literalization character.
117 .IP "z"
118 Like SPACE, but if N is specified, it becomes the new window size.
119 .IP "ENTER or RETURN or \*^N or e or \*^E or j or \*^J"
120 Scroll forward N lines, default 1.
121 The entire N lines are displayed, even if N is more than the screen size.
122 .IP "d or \*^D"
123 Scroll forward N lines, default one half of the screen size.
124 If N is specified, it becomes the new default for
125 subsequent d and u commands.
126 .IP "b or \*^B or ESC-v"
127 Scroll backward N lines, default one window (see option
128 .B "\-z"
129 below).
130 If N is more than the screen size, only the final screenful is displayed.
131 .IP "w"
132 Like ESC-v, but if N is specified, it becomes the new window size.
133 .IP "y or \*^Y or \*^P or k or \*^K"
134 Scroll backward N lines, default 1.
135 The entire N lines are displayed, even if N is more than the screen size.
136 Warning: some systems use \*^Y as a special job control character.
137 .IP "u or \*^U"
138 Scroll backward N lines, default one half of the screen size.
139 If N is specified, it becomes the new default for
140 subsequent d and u commands.
141 .IP "J"
142 Like j, but continues to scroll beyond the end of the file.
143 .IP "K or Y"
144 Like k, but continues to scroll beyond the beginning of the file.
145 .IP "ESC-SPACE"
146 Like SPACE, but scrolls a full screenful,
147 even if it reaches the end of the file.
148 .IP "ESC-b"
149 Like b, but scrolls a full screenful,
150 even if it reaches the beginning of the file.
151 .IP "ESC-j"
152 Scroll forward N file lines, default 1.
153 A file line is a complete line in the file, terminated by a newline.
154 .IP "ESC-k"
155 Scroll backwards N file lines, default 1.
156 .IP "ESC-) or RIGHTARROW"
157 Scroll horizontally right N characters, default half the screen width
158 (see the
159 .B "\-#"
160 option).
161 If a number N is specified, it becomes the default for future RIGHTARROW
162 and LEFTARROW commands.
163 While the text is scrolled, it acts as though the
164 .B "\-S"
165 option
166 (chop lines) were in effect.
167 .IP "ESC-( or LEFTARROW"
168 Scroll horizontally left N characters, default half the screen width
169 (see the
170 .B "\-#"
171 option).
172 If a number N is specified, it becomes the default for future RIGHTARROW
173 and LEFTARROW commands.
174 .IP "ESC-} or \*^RIGHTARROW or END"
175 Scroll horizontally right to show the end of the longest displayed line.
176 .IP "ESC-{ or \*^LEFTARROW or HOME"
177 Scroll horizontally left back to the first column.
178 .IP "\*^END or SHIFT-END"
179 Go to line N in the file, default the end of the file, and
180 scroll horizontally right to show the end of the longest displayed line.
181 .IP "\*^HOME or SHIFT-HOME"
182 Go to line N in the file, default 1 (beginning of file),
183 and scroll horizontally left back to the first column.
184 .IP "r or \*^R or \*^L"
185 Repaint the screen.
186 .IP R
187 Repaint the screen, discarding any buffered input.
188 That is, reload the current file.
189 Useful if the file is changing while it is being viewed.
190 .IP "F"
191 Scroll forward, and keep trying to read when the
192 end of file is reached.
193 Normally this command would be used when already at the end of the file.
194 It is a way to monitor the tail of a file which is growing
195 while it is being viewed.
196 (The behavior is similar to the "tail \-f" command.)
197 To stop waiting for more data, enter the interrupt character (usually \*^C).
198 On systems which support
199 .BR poll (2)
200 you can also use \*^X or the character specified by the
201 .B "\-\-intr"
202 option.
203 If the input is a pipe and the
204 .B "\-\-exit\-follow\-on\-close"
205 option is in effect,
206 .B less
207 will automatically stop waiting for data when the input side
208 of the pipe is closed.
209 .IP "ESC-f"
210 Like F, but each time a line is found which matches
211 the last search pattern, the terminal bell is rung.
212 .IP "ESC-F"
213 Like F, but as soon as a line is found which matches
214 the last search pattern, the terminal bell is rung
215 and forward scrolling stops.
216 .IP "g or < or ESC-<"
217 Go to line N in the file, default 1 (beginning of file).
218 (Warning: this may be slow if N is large.)
219 .IP "G or > or ESC->"
220 Go to line N in the file, default the end of the file.
221 (Warning: this may be slow if N is large,
222 or if N is not specified and
223 standard input, rather than a file, is being read.)
224 .IP "ESC-G"
225 Same as G, except if no number N is specified and the input is standard input,
226 goes to the last line which is currently buffered.
227 .IP "p or %"
228 Go to a position N percent into the file.
229 N should be between 0 and 100, and may contain a decimal point.
230 .IP "P"
231 Go to the line containing byte offset N in the file.
232 .IP "{"
233 If a left curly bracket appears in the top line displayed
234 on the screen,
235 the { command will go to the matching right curly bracket.
236 The matching right curly bracket is positioned on the bottom
237 line of the screen.
238 If there is more than one left curly bracket on the top line,
239 a number N may be used to specify the N-th bracket on the line.
240 .IP "}"
241 If a right curly bracket appears in the bottom line displayed
242 on the screen,
243 the } command will go to the matching left curly bracket.
244 The matching left curly bracket is positioned on the top
245 line of the screen.
246 If there is more than one right curly bracket on the bottom line,
247 a number N may be used to specify the N-th bracket on the line.
248 .IP "("
249 Like {, but applies to parentheses rather than curly brackets.
250 .IP ")"
251 Like }, but applies to parentheses rather than curly brackets.
252 .IP "["
253 Like {, but applies to square brackets rather than curly brackets.
254 .IP "]"
255 Like }, but applies to square brackets rather than curly brackets.
256 .IP "ESC-\*^F"
257 Followed by two characters,
258 acts like {, but uses the two characters as open and close brackets,
259 respectively.
260 For example, "ESC \*^F < >" could be used to
261 go forward to the > which matches the < in the top displayed line.
262 .IP "ESC-\*^B"
263 Followed by two characters,
264 acts like }, but uses the two characters as open and close brackets,
265 respectively.
266 For example, "ESC \*^B < >" could be used to
267 go backward to the < which matches the > in the bottom displayed line.
268 .IP m
269 Followed by any lowercase or uppercase letter,
270 marks the first displayed line with that letter.
271 If the status column is enabled via the
272 .B "\-J"
273 option,
274 the status column shows the marked line.
275 .IP M
276 Acts like m, except the last displayed line is marked
277 rather than the first displayed line.
278 .IP "\*'"
279 (Single quote.)
280 Followed by any lowercase or uppercase letter, returns to the position which
281 was previously marked with that letter.
282 Followed by another single quote, returns to the position at
283 which the last "large" movement command was executed.
284 Followed by a \*^ or $, jumps to the beginning or end of the
285 file respectively.
286 Marks are preserved when a new file is examined within a single invocation of
287 .BR less ,
288 so the \*' command can be used to switch between input files.
289 The
290 .B "\-\-save\-marks"
291 option causes marks to be preserved across different invocations of
292 .BR less .
293 .IP "\*^X\*^X"
294 Same as single quote.
295 .IP "ESC-m"
296 Followed by any lowercase or uppercase letter,
297 clears the mark identified by that letter.
298 .IP /pattern
299 Search forward in the file for the N-th line containing the pattern.
300 N defaults to 1.
301 The pattern is a regular expression, as recognized by
302 the regular expression library supplied by your system.
303 By default, searching is case-sensitive (uppercase and lowercase
304 are considered different); the
305 .B "\-i"
306 option can be used to change this.
307 The search starts at the first line displayed
308 (but see the
309 .B "\-a"
310 and
311 .B "\-j"
312 options, which change this).
313 .IP
314 Certain characters are special
315 if entered at the beginning of the pattern;
316 they modify the type of search rather than become part of the pattern:
317 .RS
318 .IP "\*^N or !"
319 Search for lines which do NOT match the pattern.
320 .IP "\*^E or *"
321 Search multiple files.
322 That is, if the search reaches the END of the current file
323 without finding a match,
324 the search continues in the next file in the command line list.
325 .IP "\*^F or @"
326 Begin the search at the first line of the FIRST file
327 in the command line list,
328 regardless of what is currently displayed on the screen
329 or the settings of the
330 .B "\-a"
331 or
332 .B "\-j"
333 options.
334 .IP "\*^K"
335 Highlight any text which matches the pattern on the current screen,
336 but don't move to the first match (KEEP current position).
337 .IP "\*^R"
338 Don't interpret regular expression metacharacters;
339 that is, do a simple textual comparison.
340 .IP "\*^S"
341 Followed by a digit N between 1 and 5.
342 Only text which has a non-empty match for the N-th parenthesized SUB-PATTERN
343 will be considered to match the pattern.
344 For example, searching for "(abc)|(def)" modified with \*^S1
345 would search for instances of "abc", but would highlight
346 instances of both "abc" and "def".
347 (Supported only if
348 .B less
349 is built with one of the regular expression libraries
350 .BR posix ", " pcre ", or " pcre2 ".)"
351 Multiple \*^S modifiers can be specified,
352 to match more than one sub-pattern.
353 .IP "\*^W"
354 WRAP around the current file.
355 That is, if the search reaches the end of the current file
356 without finding a match, the search continues from the first line of the
357 current file up to the line where it started.
358 If the \*^W modifier is set, the \*^E modifier is ignored.
359 .IP "\*^L"
360 The next character is taken literally; that is, it becomes part of the pattern
361 even if it is one of the above search modifier characters.
362 .RE
363 .IP ?pattern
364 Search backward in the file for the N-th line containing the pattern.
365 The search starts at the last line displayed
366 (but see the
367 .B "\-a"
368 and
369 .B "\-j"
370 options, which change this).
371 .IP
372 Certain characters are special as in the / command:
373 .RS
374 .IP "\*^N or !"
375 Search for lines which do NOT match the pattern.
376 .IP "\*^E or *"
377 Search multiple files.
378 That is, if the search reaches the beginning of the current file
379 without finding a match,
380 the search continues in the previous file in the command line list.
381 .IP "\*^F or @"
382 Begin the search at the last line of the last file
383 in the command line list,
384 regardless of what is currently displayed on the screen
385 or the settings of the
386 .B "\-a"
387 or
388 .B "\-j"
389 options.
390 .IP "\*^K"
391 As in forward searches.
392 .IP "\*^R"
393 As in forward searches.
394 .IP "\*^S"
395 As in forward searches.
396 .IP "\*^W"
397 WRAP around the current file.
398 That is, if the search reaches the beginning of the current file
399 without finding a match, the search continues from the last line of the
400 current file up to the line where it started.
401 .IP "\*^L"
402 As in forward searches.
403 .RE
404 .IP "ESC-/pattern"
405 Same as "/*".
406 .IP "ESC-?pattern"
407 Same as "?*".
408 .IP n
409 Repeat previous search, for N-th line containing the last pattern.
410 If the previous search was modified by \*^N, the search is made for the
411 N-th line NOT containing the pattern.
412 If the previous search was modified by \*^E, the search continues
413 in the next (or previous) file if not satisfied in the current file.
414 If the previous search was modified by \*^R, the search is done
415 without using regular expressions.
416 If the previous search was modified by \*^W, the search wraps at
417 the end (or beginning) of the file.
418 There is no effect if the previous search was modified by \*^F or \*^K.
419 .IP N
420 Repeat previous search, but in the reverse direction.
421 .IP "ESC-n"
422 Repeat previous search, but crossing file boundaries.
423 The effect is as if the previous search were modified by *.
424 .IP "ESC-N"
425 Repeat previous search, but in the reverse direction
426 and crossing file boundaries.
427 .IP "ESC-u"
428 Undo search highlighting.
429 Turn off highlighting of strings matching the current search pattern.
430 If highlighting is already off because of a previous ESC-u command,
431 turn highlighting back on.
432 Any search command will also turn highlighting back on.
433 (Highlighting can also be disabled by toggling the
434 .B "\-G"
435 option;
436 in that case search commands do not turn highlighting back on.)
437 .IP "ESC-U"
438 Like ESC-u but also clears the saved search pattern.
439 If the status column is enabled via the
440 .B "\-J"
441 option,
442 this clears all search matches marked in the status column.
443 .IP "&pattern"
444 Display only lines which match the pattern;
445 lines which do not match the pattern are not displayed.
446 If pattern is empty (if you type & immediately followed by ENTER),
447 any filtering is turned off, and all lines are displayed.
448 While filtering is in effect, an ampersand is displayed at the
449 beginning of the prompt,
450 as a reminder that some lines in the file may be hidden.
451 Multiple & commands may be entered, in which case only lines
452 which match all of the patterns will be displayed.
453 .IP
454 Certain characters are special as in the / command:
455 .RS
456 .IP "\*^N or !"
457 Display only lines which do NOT match the pattern.
458 .IP "\*^R"
459 Don't interpret regular expression metacharacters;
460 that is, do a simple textual comparison.
461 .RE
462 .IP ":e [filename]"
463 Examine a new file.
464 If the filename is missing, the "current" file (see the :n and :p commands
465 below) from the list of files in the command line is re-examined.
466 A percent sign (%) in the filename is replaced by the name of the
467 current file.
468 A pound sign (#) is replaced by the name of the previously examined file.
469 However, two consecutive percent signs are simply
470 replaced with a single percent sign.
471 This allows you to enter a filename that contains a percent sign
472 in the name.
473 Similarly, two consecutive pound signs are replaced with a single pound sign.
474 The filename is inserted into the command line list of files
475 so that it can be seen by subsequent :n and :p commands.
476 If the filename consists of several files, they are all inserted into
477 the list of files and the first one is examined.
478 If the filename contains one or more spaces,
479 the entire filename should be enclosed in double quotes
480 (also see the
481 .B "\-\[dq]"
482 option).
483 .IP "\*^X\*^V or E"
484 Same as :e.
485 Warning: some systems use \*^V as a special literalization character.
486 On such systems, you may not be able to use \*^V.
487 .IP ":n"
488 Examine the next file (from the list of files given in the command line).
489 If a number N is specified, the N-th next file is examined.
490 .IP ":p"
491 Examine the previous file in the command line list.
492 If a number N is specified, the N-th previous file is examined.
493 .IP ":x"
494 Examine the first file in the command line list.
495 If a number N is specified, the N-th file in the list is examined.
496 .IP ":d"
497 Remove the current file from the list of files.
498 .IP "t"
499 Go to the next tag, if there were more than one matches for the current tag.
500 See the
501 .B "\-t"
502 option for more details about tags.
503 .IP "T"
504 Go to the previous tag, if there were more than one matches for the current tag.
505 .IP "\*^O\*^N or \*^On"
506 Search forward in the file for the N-th next OSC 8 hyperlink.
507 .IP "\*^O\*^P or \*^Op"
508 Search backward in the file for the N-th previous OSC 8 hyperlink.
509 .IP "\*^O\*^L or \*^Ol"
510 Jump to the currently selected OSC 8 hyperlink.
511 .IP "= or \*^G or :f"
512 Prints some information about the file being viewed,
513 including its name
514 and the line number and byte offset of the bottom line being displayed.
515 If possible, it also prints the length of the file,
516 the number of lines in the file
517 and the percent of the file above the last displayed line.
518 .IP \-
519 Followed by one of the command line option letters (see OPTIONS below),
520 this will change the setting of that option
521 and print a message describing the new setting.
522 If a \*^P (CONTROL-P) is entered immediately after the dash,
523 the setting of the option is changed but no message is printed.
524 If the option letter has a numeric value (such as
525 .B "\-b"
526 or
527 .BR "\-h" "),"
528 or a string value (such as
529 .B "\-P"
530 or
531 .BR "\-t" "),"
532 a new value may be entered after the option letter.
533 If no new value is entered, a message describing
534 the current setting is printed and nothing is changed.
535 .IP \-\-
536 Like the \- command, but takes a long option name (see OPTIONS below)
537 rather than a single option letter.
538 Press ENTER or RETURN after typing the option name to change it.
539 You can enter just the beginning of an option name,
540 then press TAB to find all option names which begin with that string.
541 A \*^P immediately after the second dash suppresses printing of a
542 message describing the new setting, as in the \- command.
543 .IP \-+
544 Followed by one of the command line option letters
545 this will reset the option to its default setting
546 and print a message describing the new setting.
547 (The "\-+\fIX\fP" command does the same thing
548 as
549 .RB "\[dq]" "\-+X" "\[dq]"
550 on the command line.)
551 This does not work for string-valued options.
552 .IP \-\-+
553 Like the \-+ command, but takes a long option name
554 rather than a single option letter.
555 .IP \-!
556 Followed by one of the command line option letters,
557 this will reset the option to the "opposite" of its default setting
558 and print a message describing the new setting.
559 This does not work for numeric or string-valued options.
560 .IP \-\-!
561 Like the \-!\& command, but takes a long option name
562 rather than a single option letter.
563 .IP _
564 (Underscore.)
565 Followed by one of the command line option letters,
566 this will print a message describing the current setting of that option.
567 The setting of the option is not changed.
568 .IP __
569 (Double underscore.)
570 Like the _ (underscore) command, but takes a long option name
571 rather than a single option letter.
572 You must press ENTER or RETURN after typing the option name.
573 .IP +cmd
574 Causes the specified cmd to be executed each time a new file is examined.
575 For example, +G causes
576 .B less
577 to initially display each file starting at the end
578 rather than the beginning.
579 .IP V
580 Prints the version number of
581 .B less
582 being run.
583 .IP "q or Q or :q or :Q or ZZ"
584 Exits
585 .BR less .
586 .PP
587 The following
588 seven
589 commands may or may not be valid, depending on your particular installation.
590 .
591 .IP v
592 Invokes an editor to edit the current file being viewed.
593 The editor is taken from the environment variable VISUAL if defined,
594 or EDITOR if VISUAL is not defined,
595 or defaults to "vi" if neither VISUAL nor EDITOR is defined.
596 See also the discussion of LESSEDIT under the section on PROMPTS below.
597 .IP "! shell-command"
598 Invokes a shell to run the shell-command given.
599 A percent sign (%) in the command is replaced by the name of the
600 current file.
601 A pound sign (#) is replaced by the name of the previously examined file.
602 "!!" repeats the last shell command.
603 "!" with no shell command invokes an interactive shell.
604 If a \*^P (CONTROL-P) is entered immediately after the !,
605 no "done" message is printed after the shell command is executed.
606 On Unix systems, the shell is taken from the environment variable SHELL,
607 or defaults to "sh".
608 On MS-DOS, Windows, and OS/2 systems, the shell is the normal command processor.
609 .IP "# shell-command"
610 Similar to the "!" command,
611 except that the command is expanded in the same way as prompt strings.
612 For example, the name of the current file would be given as "%f".
613 .IP "| <m> shell-command"
614 <m> represents any mark letter.
615 Pipes a section of the input file to the given shell command.
616 The section of the file to be piped is between the position marked by
617 the letter and the current screen.
618 The entire current screen is included, regardless of whether the
619 marked position is before or after the current screen.
620 <m> may also be \*^ or $ to indicate beginning or end of file respectively.
621 If <m> is \&.\& or newline, the current screen is piped.
622 If a \*^P (CONTROL-P) is entered immediately after the mark letter,
623 no "done" message is printed after the shell command is executed.
624 .IP "s filename"
625 Save the input to a file.
626 This works only if the input is a pipe, not an ordinary file.
627 .IP "\*^O\*^O"
628 .RS
629 Run a shell command to open the URI in the current OSC 8 hyperlink,
630 selected by a previous \*^O\*^N or \*^O\*^P command.
631 To find the shell command,
632 the environment variable named "LESS_OSC8_xxx" is read,
633 where "xxx" is the scheme from the URI (the part before the first colon),
634 or is empty if there is no colon in the URI.
635 The value of the environment variable is then expanded in the same way as
636 prompt strings (in particular, any instance of "%o" is replaced with the URI)
637 to produce an OSC 8 "handler" shell command.
638 The standard output from the handler is an "opener" shell command
639 which is then executed to open the URI.
640 .PP
641 There are two special cases:
642 .RS
643 .IP 1.
644 If the URI begins with "#", the remainder of the URI is taken to be
645 the value of the id parameter in another OSC 8 link in the same file,
646 and \*^O\*^O will simply jump to that link.
647 .IP 2.
648 If the opener begins with the characters ":e" followed by
649 whitespace and a filename,
650 then instead of running the opener as a shell command,
651 the specified filename is opened in the current instance of
652 .BR less .
653 .RE
654 .PP
655 In a simple case where the opener accepts the complete URI
656 as a command line parameter, the handler may be as simple as
657 .PP
658 .EX
659 .nf
660 echo mybrowser \*'%o\*'
661 .fi
662 .EE
663 .PP
664 In other cases, the URI may need to be modified, so the handler
665 may have to do some manipulation of the %o value.
666 .PP
667 If the LESS_OSC8_xxx variable is not set, the variable LESS_OSC8_ANY is tried.
668 If neither LESS_OSC8_xxx nor LESS_OSC8_ANY is set,
669 links using the "xxx" scheme cannot be opened.
670 However, there are default handlers for the
671 schemes "man" (used when LESS_OSC8_man is not set)
672 and "file" (used when LESS_OSC8_file is not set),
673 which should work on systems which provide the
674 .BR sed (1)
675 command and a shell with syntax compatible with the Bourne shell
676 .BR sh (1).
677 If you use LESS_OSC8_ANY to override LESS_OSC8_file, you must
678 set LESS_OSC8_file to "\-" to indicate that the default value
679 should not be used, and likewise for LESS_OSC8_man.
680 .PP
681 The URI passed to an OSC8 handler via %o is guaranteed not to contain any single quote
682 or double quote characters, but it may contain any other shell metacharacters
683 such as semicolons, dollar signs, ampersands, etc.
684 The handler should take care to appropriately quote parameters in the opener command,
685 to prevent execution of unintended shell commands in the case of opening
686 a URI which contains shell metacharacters.
687 Also, since the handler command is expanded like a command prompt,
688 any metacharacters interpreted by prompt expansion
689 (such as percent, dot, colon, backslash, etc.) must be escaped with a backslash
690 (see the PROMPTS section for details).
691 .RE
692 .IP "\*^X"
693 When the "Waiting for data" message is displayed,
694 such as while in the F command, pressing \*^X
695 will stop
696 .B less
697 from waiting and return to a prompt.
698 This may cause
699 .B less
700 to think that the file ends at the current position,
701 so it may be necessary to use the R or F command to see more data.
702 The
703 .B "\-\-intr"
704 option can be used to specify a different character
705 to use instead of \*^X.
706 This command works only on systems that support the
707 .BR poll (2)
708 function.
709 On systems without
710 .BR poll (2),
711 the interrupt character (usually \*^C) can be used instead.
712 .
713 .SH OPTIONS
714 Command line options are described below.
715 Most options may be changed while
716 .B less
717 is running, via the "\-" command.
718 .PP
719 Some options may be given in one of two forms:
720 either a dash followed by a single letter,
721 or two dashes followed by a long option name.
722 A long option name may be abbreviated as long as
723 the abbreviation is unambiguous.
724 For example,
725 .B "\-\-mouse"
726 may be abbreviated
727 .BR "\-\-mou" ","
728 but not
729 .BR "\-\-mo" ","
730 since both
731 .B "\-\-mouse"
732 and
733 .B "\-\-modelines"
734 begin with
735 .BR "\-\-mo" "."
736
737 Some long option names are in uppercase, such as
738 .BR "\-\-QUIT\-AT\-EOF" ","
739 as
740 distinct from
741 .BR "\-\-quit\-at\-eof" "."
742 Such option names need only have their first letter capitalized;
743 the remainder of the name may be in either case.
744 For example,
745 .B "\-\-Quit\-at\-eof"
746 is equivalent to
747 .BR "\-\-QUIT\-AT\-EOF" "."
748 .PP
749 Options are also taken from the environment variable "LESS".
750 For example,
751 to avoid typing "less \-options \&...\&" each time
752 .B less
753 is invoked, you might tell
754 .BR csh :
755 .PP
756 setenv LESS "\-options"
757 .PP
758 or if you use
759 .BR sh :
760 .PP
761 LESS="\-options"; export LESS
762 .PP
763 On MS-DOS and Windows, you don't need the quotes, but you should
764 be careful that any percent signs in the options string are not
765 interpreted as an environment variable expansion.
766 .PP
767 The environment variable is parsed before the command line,
768 so command line options override the LESS environment variable.
769 If an option appears in the LESS variable, it can be reset
770 to its default value on the command line by beginning the command
771 line option with
772 .RB "\[dq]" "\-+" "\[dq]."
773 .PP
774 Some options like
775 .B "\-k"
776 or
777 .B "\-D"
778 require a string to follow the option letter.
779 The string for that option is considered to end when a dollar sign ($) is found.
780 For example, you can set two
781 .B "\-D"
782 options like this:
783 .PP
784 .EX
785 LESS="Dnwb$Dsbw"
786 .EE
787 .PP
788 If the
789 .B "\-\-use\-backslash"
790 option appears earlier in the options, then
791 a dollar sign or backslash may be included literally in an option string
792 by preceding it with a backslash.
793 If the
794 .B "\-\-use\-backslash"
795 option is not in effect, then backslashes are
796 not treated specially, and there is no way to include a dollar sign
797 in the option string.
798 .IP "\fB\-?\fP or \fB\-\-help\fP"
799 This option displays a summary of the commands accepted by
800 .B less
801 (the same as the h command).
802 (Depending on how your shell interprets the question mark,
803 it may be necessary to quote the question mark, thus: "\fB\-\e?\fP".)
804 .IP "\fB\-a\fP or \fB\-\-search\-skip\-screen\fP"
805 By default, forward searches start at the top of the displayed screen
806 and backwards searches start at the bottom of the displayed screen
807 (except for repeated searches invoked by the n or N commands,
808 which start after or before the "target" line respectively;
809 see the
810 .B "\-j"
811 option for more about the target line).
812 The
813 .B "\-a"
814 option causes forward searches to instead start at
815 the bottom of the screen
816 and backward searches to start at the top of the screen,
817 thus skipping all lines displayed on the screen.
818 .IP "\fB\-A\fP or \fB\-\-SEARCH\-SKIP\-SCREEN\fP"
819 Causes all forward searches (not just non-repeated searches)
820 to start just after the target line, and all backward searches
821 to start just before the target line.
822 Thus, forward searches will skip part of the displayed screen
823 (from the first line up to and including the target line).
824 Similarly backwards searches will skip the displayed screen
825 from the last line up to and including the target line.
826 This was the default behavior in less versions prior to 441.
827 .IP "\fB\-b\fP\fIn\fP or \fB\-\-buffers=\fP\fIn\fP"
828 Specifies the amount of buffer space
829 .B less
830 will use for each file, in units of kilobytes (1024 bytes).
831 By default 64\ KB of buffer space is used for each file
832 (unless the file is a pipe; see the
833 .B "\-B"
834 option).
835 The
836 .B "\-b"
837 option specifies instead that \fIn\fP kilobytes of
838 buffer space should be used for each file.
839 If \fIn\fP is \-1, buffer space is unlimited; that is,
840 the entire file can be read into memory.
841 .IP "\fB\-B\fP or \fB\-\-auto\-buffers\fP"
842 By default, when data is read from a pipe,
843 buffers are allocated automatically as needed.
844 If a large amount of data is read from the pipe, this can cause
845 a large amount of memory to be allocated.
846 The
847 .B "\-B"
848 option disables this automatic allocation of buffers for pipes,
849 so that only 64\ KB
850 (or the amount of space specified by the
851 .B "\-b"
852 option)
853 is used for the pipe.
854 Warning: use of
855 .B "\-B"
856 can result in erroneous display, since only the
857 most recently viewed part of the piped data is kept in memory;
858 any earlier data is lost.
859 Lost characters are displayed as question marks.
860 .IP "\fB\-c\fP or \fB\-\-clear\-screen\fP"
861 Causes full screen repaints to be painted from the top line down.
862 By default,
863 full screen repaints are done by scrolling from the bottom of the screen.
864 .IP "\fB\-C\fP or \fB\-\-CLEAR\-SCREEN\fP"
865 Same as
866 .BR "\-c" ","
867 for compatibility with older versions of
868 .BR less .
869 .IP "\fB\-d\fP or \fB\-\-dumb\fP"
870 The
871 .B "\-d"
872 option suppresses the error message
873 normally displayed if the terminal is dumb;
874 that is, lacks some important capability,
875 such as the ability to clear the screen or scroll backward.
876 The
877 .B "\-d"
878 option does not otherwise change the behavior of
879 .B less
880 on a dumb terminal.
881 .IP "\fB\-Dx\fP\fIcolor\fP or \fB\-\-color=x\fP\fIcolor\fP"
882 Changes the color of different parts of the displayed text.
883 \fBx\fP is a single character which selects the type of text
884 whose color is being set:
885 .RS
886 .IP "B"
887 Binary characters.
888 .IP "C"
889 Control characters.
890 .IP "E"
891 Errors and informational messages.
892 .IP "H"
893 Header lines and columns, set via the
894 .B "\-\-header"
895 option.
896 .IP "M"
897 Mark letters in the status column.
898 .IP "N"
899 Line numbers enabled via the
900 .B "\-N"
901 option.
902 .IP "P"
903 Prompts.
904 .IP "R"
905 The rscroll character.
906 .IP "S"
907 Search results.
908 .IP "W"
909 The highlight enabled via the
910 .B "\-w"
911 option.
912 .IP "1\-5"
913 The text in a search result which matches
914 the first through fifth parenthesized sub-pattern.
915 Sub-pattern coloring works only if
916 .B less
917 is built with one of the regular expression libraries
918 .BR posix ", " pcre ", or " pcre2 .
919 .IP "d"
920 Bold text.
921 .IP "k"
922 Blinking text.
923 .IP "s"
924 Standout text.
925 .IP "u"
926 Underlined text.
927 .RE
928 .PP
929 .RS
930 The uppercase letters and digits can be used only when the
931 .B "\-\-use\-color"
932 option is enabled.
933 When text color is specified by both an uppercase letter and a lowercase letter,
934 the uppercase letter takes precedence.
935 For example, error messages are normally displayed as standout text.
936 So if both "s" and "E" are given a color, the "E" color applies
937 to error messages, and the "s" color applies to other standout text.
938 The lowercase letters refer to bold and underline text formed by
939 overstriking with backspaces (see the
940 .B "\-U"
941 option) and to non-content
942 text (such as line numbers and prompts),
943 but not to text formatted using ANSI escape sequences with the
944 .B "\-R"
945 option
946 (but see the note below for different behavior on Windows and MS-DOS).
947 .PP
948 A lowercase letter may be followed by a + to indicate that
949 the normal format change and the specified color should both be used.
950 For example,
951 .B "\-Dug"
952 displays underlined text as green without underlining;
953 the green color has replaced the usual underline formatting.
954 But
955 .B "\-Du+g"
956 displays underlined text as both green and in underlined format.
957 .PP
958 \fIcolor\fP is either a 4-bit color string or an 8-bit color string:
959 .PP
960 A 4-bit color string is one or two characters, where
961 the first character specifies the foreground color and
962 the second specifies the background color as follows:
963 .IP "b"
964 Blue
965 .IP "c"
966 Cyan
967 .IP "g"
968 Green
969 .IP "k"
970 Black
971 .IP "m"
972 Magenta
973 .IP "r"
974 Red
975 .IP "w"
976 White
977 .IP "y"
978 Yellow
979 .PP
980 The corresponding uppercase letter denotes a brighter shade of the color.
981 For example,
982 .B "\-DNGk"
983 displays line numbers as bright green text on a black
984 background, and
985 .B "\-DEbR"
986 displays error messages as blue text on a
987 bright red background.
988 If either character is a "\-" or is omitted, the corresponding color
989 is set to that of normal text.
990 .PP
991 An 8-bit color string is one or two decimal integers separated by a dot,
992 where the first integer specifies the foreground color and
993 the second specifies the background color.
994 Each integer is a value between 0 and 255 inclusive which selects
995 a "CSI 38;5" color value (see
996 .nh
997 https://\*:en\*:.wikipedia\*:.org/\*:wiki/\*:ANSI_escape_code\*:#SGR).
998 .hy
999 If either integer is a "\-" or is omitted,
1000 the corresponding color is set to that of normal text.
1001 .PP
1002 A 4-bit or 8-bit color string may be followed by one or more of the
1003 following characters to set text attributes in addition to the color.
1004 .IP "s or ~"
1005 Standout (reverse video)
1006 .IP "u or _"
1007 Underline
1008 .IP "d or *"
1009 Bold
1010 .IP "l or &"
1011 Blinking
1012 .PP
1013 On MS-DOS and Windows, the
1014 .B "\-\-color"
1015 option behaves
1016 differently from what is described above in these ways:
1017 .IP \(bu
1018 The bold (d and *) and blinking (l and &) text attributes
1019 at the end of a color string are not supported.
1020 .IP \(bu
1021 Lowercase color selector letters refer to text formatted by ANSI
1022 escape sequences with
1023 .BR "\-R" ","
1024 in addition to overstruck and non-content text (but see
1025 .BR "\-Da" ")."
1026 .IP \(bu
1027 For historical reasons, when a lowercase color selector letter
1028 is followed by a numeric color value,
1029 the number is not interpreted as an "CSI 38;5" color value as described above,
1030 but instead as a 4-bit
1031 .nh
1032 CHAR_INFO.Attributes
1033 .hy
1034 value, between 0 and 15 inclusive
1035 (see
1036 .nh
1037 https://\*:learn\*:.microsoft\*:.com/\*:en\-us/\*:windows/\*:console/\*:char\-info\-str).
1038 .hy
1039 .IP
1040 To avoid confusion, it is recommended that the equivalent letters rather than numbers
1041 be used after a lowercase color selector on MS-DOS/Windows.
1042 .IP \(bu
1043 Numeric color values ("CSI 38;5" color) following an uppercase color selector letter
1044 are not supported on systems earlier than Windows 10.
1045 .IP \(bu
1046 Only a limited set of ANSI escape sequences to set color in the content work correctly.
1047 4-bit color sequences work, but "CSI 38;5" color sequences do not.
1048 .IP \(bu
1049 The
1050 .B "\-Da"
1051 option makes the behavior of
1052 .B "\-\-color"
1053 more similar to its behavior on non-MS-DOS/Windows systems by (1)
1054 making lowercase color selector letters not affect text formatted
1055 with ANSI escape sequences, and (2)
1056 allowing "CSI 38;5" color sequences in the content
1057 work by passing them to the terminal (only on Windows 10 and later; on
1058 earlier Windows systems, such sequences do not work regardless of the setting of
1059 .BR "\-Da" ")."
1060 .RE
1061 .IP "\fB\-e\fP or \fB\-\-quit\-at\-eof\fP"
1062 Causes
1063 .B less
1064 to automatically exit
1065 the second time it reaches end-of-file.
1066 By default, the only way to exit
1067 .B less
1068 is via the "q" command.
1069 .IP "\fB\-E\fP or \fB\-\-QUIT\-AT\-EOF\fP"
1070 Causes
1071 .B less
1072 to automatically exit the first time it reaches end-of-file.
1073 .IP "\fB\-f\fP or \fB\-\-force\fP"
1074 Forces non-regular files to be opened.
1075 (A non-regular file is a directory or a device special file.)
1076 Also suppresses the warning message when a binary file is opened.
1077 By default,
1078 .B less
1079 will refuse to open non-regular files.
1080 Note that some operating systems will not allow directories
1081 to be read, even if
1082 .B "\-f"
1083 is set.
1084 .IP "\fB\-F\fP or \fB\-\-quit\-if\-one\-screen\fP"
1085 Causes
1086 .B less
1087 to automatically exit
1088 if the entire file can be displayed on the first screen.
1089 Also see the description of the LESS_SHELL_LINES environment variable below.
1090 .IP "\fB\-g\fP or \fB\-\-hilite\-search\fP"
1091 Normally,
1092 .B less
1093 will highlight ALL strings which match the last search command.
1094 The
1095 .B "\-g"
1096 option changes this behavior to highlight only the particular string
1097 which was found by the last search command.
1098 This can cause
1099 .B less
1100 to run somewhat faster than the default.
1101 .IP "\fB\-G\fP or \fB\-\-HILITE\-SEARCH\fP"
1102 The \-G option suppresses all highlighting of strings found by search commands.
1103 .IP "\-\-old-bot"
1104 Reverts to the old bottom of screen behavior. This can be sometimes
1105 desirable if the long lines are not wrapped correctly
1106 when reaching the bottom of the terminal, while scrolling forward.
1107 .IP "\fB\-h\fP\fIn\fP or \fB\-\-max\-back\-scroll=\fP\fIn\fP"
1108 Specifies a maximum number of lines to scroll backward.
1109 If it is necessary to scroll backward more than \fIn\fP lines,
1110 the screen is repainted in a forward direction instead.
1111 (If the terminal does not have the ability to scroll
1112 backward,
1113 .B "\-h0"
1114 is implied.)
1115 .IP "\fB\-i\fP or \fB\-\-ignore\-case\fP"
1116 Causes searches to ignore case; that is,
1117 uppercase and lowercase are considered identical.
1118 This option is ignored if any uppercase letters
1119 appear in the search pattern;
1120 in other words,
1121 if a pattern contains uppercase letters, then that search does not ignore case.
1122 .IP "\fB\-I\fP or \fB\-\-IGNORE\-CASE\fP"
1123 Like
1124 .BR "\-i" ","
1125 but searches ignore case even if
1126 the pattern contains uppercase letters.
1127 .IP "\fB\-j\fP\fIn\fP or \fB\-\-jump\-target=\fP\fIn\fP"
1128 Specifies a line on the screen where the "target" line
1129 is to be positioned.
1130 The target line is the line specified by any command to
1131 search for a pattern, jump to a line number,
1132 jump to a file percentage or jump to a tag.
1133 The screen line may be specified by a number: the top line on the screen
1134 is 1, the next is 2, and so on.
1135 The number may be negative to specify a line relative to the bottom
1136 of the screen: the bottom line on the screen is \-1, the second
1137 to the bottom is \-2, and so on.
1138 Alternately, the screen line may be specified as a fraction of the height
1139 of the screen, starting with a decimal point: \&.5 is in the middle of the
1140 screen, \&.3 is three tenths down from the first line, and so on.
1141 If the line is specified as a fraction, the actual line number
1142 is recalculated if the terminal window is resized.
1143 If the
1144 .B "\-\-header"
1145 option is used and the target line specified by
1146 .B "\-j"
1147 would be obscured by the header, the target line is moved to the first
1148 line after the header.
1149 .RS
1150 .PP
1151 If any form of the
1152 .B "\-j"
1153 option is used,
1154 repeated forward searches (invoked with "n" or "N")
1155 begin at the line immediately after the target line,
1156 and repeated backward searches begin at the target line,
1157 unless changed by
1158 .B "\-a"
1159 or
1160 .BR "\-A" "."
1161 For example, if
1162 .RB "\[dq]" "\-j4" "\[dq]"
1163 is used, the target line is the
1164 fourth line on the screen, so forward searches begin at the fifth line
1165 on the screen.
1166 However nonrepeated searches (invoked with "/" or "?")
1167 always begin at the first or last line on the screen respectively.
1168 .RE
1169 .IP "\fB\-J\fP or \fB\-\-status\-column\fP"
1170 Displays a status column at the left edge of the screen.
1171 The character displayed in the status column may be one of:
1172 .RS
1173 .IP ">"
1174 The line is chopped with the
1175 .B "\-S"
1176 option, and
1177 the text that is chopped off beyond the right edge of the screen
1178 contains a match for the current search.
1179 .IP "<"
1180 The line is horizontally shifted, and
1181 the text that is shifted beyond the left side of the screen
1182 contains a match for the current search.
1183 .IP "="
1184 The line is both chopped and shifted,
1185 and there are matches beyond both sides of the screen.
1186 .IP "*"
1187 There are matches in the visible part of the line
1188 but none to the right or left of it.
1189 .IP "a-z, A-Z"
1190 The line has been marked with the corresponding letter via the m or M command.
1191 .IP "#"
1192 The line has been marked by left-clicking it with the mouse
1193 when the
1194 .B "\-\-mouse"
1195 option is in effect.
1196 .RE
1197 .IP "\fB\-k\fP\fIfilename\fP or \fB\-\-lesskey\-file=\fP\fIfilename\fP"
1198 Causes
1199 .B less
1200 to open and interpret the named file as a
1201 .BR lesskey (1)
1202 binary file.
1203 Multiple
1204 .B "\-k"
1205 options may be specified.
1206 If the LESSKEY or LESSKEY_SYSTEM environment variable is set, or
1207 if a lesskey file is found in a standard place (see KEY BINDINGS),
1208 it is also used as a
1209 .B lesskey
1210 file.
1211 Note the warning under
1212 .B "\-\-lesskey\-content"
1213 below.
1214 .IP "\fB\-\-lesskey\-src=\fP\fIfilename\fP"
1215 Causes
1216 .B less
1217 to open and interpret the named file as a
1218 .BR lesskey (1)
1219 source file.
1220 If the LESSKEYIN or LESSKEYIN_SYSTEM environment variable is set, or
1221 if a lesskey source file is found in a standard place (see KEY BINDINGS),
1222 it is also used as a lesskey source file.
1223 Prior to version 582, the
1224 .B lesskey
1225 program needed to be run to convert a lesskey
1226 .I source
1227 file to a lesskey
1228 .I binary
1229 file for
1230 .B less
1231 to use.
1232 Newer versions of
1233 .B less
1234 read the lesskey source
1235 file directly and ignore the binary file if the source file exists.
1236 Note the warning under
1237 .B "\-\-lesskey\-content"
1238 below.
1239 .IP "\fB\-\-lesskey\-content=\fP\fItext\fP"
1240 Causes
1241 .B less
1242 to interpret the specified text as the contents of a
1243 .BR lesskey (1)
1244 source file.
1245 In the text,
1246 .B lesskey
1247 lines may be separated by either newlines as usual, or by semicolons.
1248 A literal semicolon may be represented by a backslash followed by a semicolon.
1249 .IP
1250 Warning: certain environment variables such as
1251 LESS, LESSSECURE, LESSCHARSET and others,
1252 which are used early in startup,
1253 cannot be set in a file specified by a command line option
1254 .RB "(" "\-\-lesskey" "," "\-\-lesskey\-src" " or " "\-\-lesskey\-content" ")."
1255 When using a
1256 .B lesskey
1257 file to set environment variables, it is safer to use the
1258 default lesskey file, or to specify the file using the
1259 LESSKEYIN or LESSKEY_CONTENT environment variables rather than using
1260 a command line option.
1261 .IP "\fB\-K\fP or \fB\-\-quit\-on\-intr\fP"
1262 Causes
1263 .B less
1264 to exit immediately (with status 2)
1265 when an interrupt character (usually \*^C) is typed.
1266 Normally, an interrupt character causes
1267 .B less
1268 to stop whatever it is doing and return to its command prompt.
1269 .IP "\fB\-L\fP or \fB\-\-no\-lessopen\fP"
1270 Ignore the LESSOPEN environment variable
1271 (see the INPUT PREPROCESSOR section below).
1272 This option can be set from within
1273 .BR less ,
1274 but it will apply only to files opened subsequently, not to the
1275 file which is currently open.
1276 .IP "\fB\-m\fP or \fB\-\-long\-prompt\fP"
1277 Causes
1278 .B less
1279 to prompt verbosely (like
1280 .BR more (1)),
1281 with the percent into the file.
1282 By default,
1283 .B less
1284 prompts with a colon.
1285 .IP "\fB\-M\fP or \fB\-\-LONG\-PROMPT\fP"
1286 Causes
1287 .B less
1288 to prompt even more verbosely than
1289 .BR more (1).
1290 .IP "\fB\-n\fP or \fB\-\-line\-numbers\fP"
1291 Suppresses line numbers.
1292 The default (to use line numbers) may cause
1293 .B less
1294 to run more slowly in some cases, especially with a very large input file.
1295 Using line numbers means: the line number will be displayed in the verbose
1296 prompt and in the = command,
1297 and the v command will pass the current line number to the editor
1298 (see also the discussion of LESSEDIT in PROMPTS below).
1299 .IP "\fB\-N\fP or \fB\-\-LINE\-NUMBERS\fP"
1300 Causes a line number to be displayed at the beginning of
1301 each line in the display.
1302 .IP "\fB\-o\fP\fIfilename\fP or \fB\-\-log\-file=\fP\fIfilename\fP"
1303 Causes
1304 .B less
1305 to copy its input to the named file as it is being viewed.
1306 This applies only when the input file is a pipe,
1307 not an ordinary file.
1308 If the file already exists,
1309 .B less
1310 will ask for confirmation before overwriting it.
1311 .IP "\fB\-O\fP\fIfilename\fP or \fB\-\-LOG\-FILE=\fP\fIfilename\fP"
1312 The
1313 .B "\-O"
1314 option is like
1315 .B "\-o,"
1316 but it will overwrite an existing
1317 file without asking for confirmation.
1318 .IP
1319 If no log file has been specified,
1320 the
1321 .B "\-o"
1322 and
1323 .B "\-O"
1324 options can be used from within
1325 .B less
1326 to specify a log file.
1327 Without a file name, they will simply report the name of the log file.
1328 The "s" command is equivalent to specifying
1329 .B "\-o"
1330 from within
1331 .BR less .
1332 .IP "\fB\-p\fP\fIpattern\fP or \fB\-\-pattern=\fP\fIpattern\fP"
1333 The \-p option on the command line is equivalent to
1334 specifying +/\fIpattern\fP;
1335 that is, it tells
1336 .B less
1337 to start at the first occurrence of \fIpattern\fP in the file.
1338 .IP "\fB\-P\fP\fIprompt\fP or \fB\-\-prompt=\fP\fIprompt\fP"
1339 Provides a way to tailor the three prompt
1340 styles to your own preference.
1341 This option would normally be put in the LESS environment
1342 variable, rather than being typed in with each
1343 .B less
1344 command.
1345 Such an option must either be the last option in the LESS variable,
1346 or be terminated by a dollar sign.
1347 .PP
1348 .RS
1349 .TP
1350 \fB\-Ps\fP
1351 followed by a string changes the default (short) prompt
1352 to that string.
1353 .TP
1354 \fB\-Pm\fP
1355 changes the medium
1356 .RB "(" "\-m" ")"
1357 prompt.
1358 .TP
1359 \fB\-PM\fP
1360 changes the long
1361 .RB "(" "\-M" ")"
1362 prompt.
1363 .TP
1364 \fB\-Ph\fP
1365 changes the prompt for the help screen.
1366 .TP
1367 \fB\-P=\fP
1368 changes the message printed by the = command.
1369 .TP
1370 \fB\-Pw\fP
1371 changes the message printed while waiting for data (in the "F" command).
1372 .RE
1373 .IP
1374 All prompt strings consist of a sequence of
1375 letters and special escape sequences.
1376 See the section on PROMPTS for more details.
1377 .IP "\fB\-q\fP or \fB\-\-quiet\fP or \fB\-\-silent\fP"
1378 Causes moderately "quiet" operation:
1379 the terminal bell is not rung
1380 if an attempt is made to scroll past the end of the file
1381 or before the beginning of the file.
1382 If the terminal has a "visual bell", it is used instead.
1383 The bell will be rung on certain other errors,
1384 such as typing an invalid character.
1385 The default is to ring the terminal bell in all such cases.
1386 .IP "\fB\-Q\fP or \fB\-\-QUIET\fP or \fB\-\-SILENT\fP"
1387 Causes totally "quiet" operation:
1388 the terminal bell is never rung.
1389 If the terminal has a "visual bell", it is used in all cases
1390 where the terminal bell would have been rung.
1391 .IP "\fB\-r\fP or \fB\-\-raw\-control\-chars\fP"
1392 Causes "raw" control characters to be displayed.
1393 The default is to display control characters using the caret notation;
1394 for example, a control-A (octal 001) is displayed as "\*^A"
1395 (with some exceptions as described under the
1396 .B "\-U"
1397 option).
1398 Warning: when the
1399 .B "\-r"
1400 option is used,
1401 .B less
1402 cannot keep track of the actual appearance of the screen
1403 (since this depends on how the screen responds to
1404 each type of control character).
1405 Thus, various display problems may result,
1406 such as long lines being split in the wrong place.
1407 .IP
1408 USE OF THE
1409 .B "\-r"
1410 OPTION IS DANGEROUS AND IS NOT RECOMMENDED.
1411 .br
1412 The
1413 .B "\-r"
1414 option can be set on the command line or via the \- command,
1415 but to avoid unintentional use, it cannot be set in a LESS environment variable.
1416 If
1417 .B "\-r"
1418 appears in a LESS environment variable, it is treated as if it were
1419 .BR "\-R" "."
1420 .IP "\fB\-R\fP or \fB\-\-RAW\-CONTROL\-CHARS\fP"
1421 Like
1422 .BR "\-r" ","
1423 but only a limited set of escape
1424 sequences are output in "raw" form.
1425 Unlike
1426 .BR "\-r" ","
1427 the screen appearance is maintained correctly.
1428 The sequences which are output raw are:
1429 .IP
1430 1. ANSI SGR ("color") sequences
1431 .IP
1432 2. OSC 8 hyperlinks
1433 .IP
1434 3. Other OSC sequences, if the OSC type number is listed in
1435 the LESSANSIOSCALLOW environment variable
1436 .IP
1437 4. OSC sequences starting with a non-standard introductory character
1438 (that is, something other than "]"), if the character is listed in
1439 the LESSANSIOSCCHARS environment variable followed by an asterisk
1440 .IP
1441 ANSI color escape sequences are sequences of the form:
1442 .IP
1443 .EX
1444 ESC [ \&...\& m
1445 .EE
1446 .IP
1447 where the "...\&" is zero or more color specification characters.
1448 Color escape sequences are only supported when the color
1449 is changed within one line, not across lines.
1450 In other words, the beginning of each line is assumed to be
1451 normal (non-colored), regardless of any escape sequences in previous lines.
1452 .IP
1453 You can make
1454 .B less
1455 think that characters other than "m" can end ANSI color escape sequences
1456 by setting the environment variable LESSANSIENDCHARS to the list of
1457 characters which can end a color escape sequence.
1458 And you can make
1459 .B less
1460 think that characters other than the standard ones may appear between
1461 the ESC and the m by setting the environment variable LESSANSIMIDCHARS
1462 to the list of characters which can appear.
1463 .IP
1464 OSC sequences are of the form:
1465 .IP
1466 .EX
1467 ESC ] N ; \&...\& \e7
1468 .EE
1469 .IP
1470 where the OSC type number N is a decimal integer.
1471 The terminating sequence may be either a BEL character (\e7)
1472 as above, or the two-character sequence "ESC \e".
1473 .IP "\fB\-s\fP or \fB\-\-squeeze\-blank\-lines\fP"
1474 Causes consecutive blank lines to be squeezed into a single blank line.
1475 This is useful when viewing
1476 .BR nroff (1)
1477 output.
1478 .IP "\fB\-S\fP or \fB\-\-chop\-long\-lines\fP"
1479 Causes lines longer than the screen width to be
1480 chopped (truncated) rather than wrapped.
1481 That is, the portion of a long line that does not fit in
1482 the screen width is not displayed until you press RIGHT-ARROW.
1483 The default is to wrap long lines; that is, display the remainder
1484 on the next line.
1485 See also the
1486 .B "\-\-wordwrap"
1487 option.
1488 While the
1489 .B "\-\-header"
1490 option is active, the
1491 .B "\-S"
1492 option is ignored,
1493 and lines longer than the screen width are truncated.
1494 .IP "\fB\-t\fP\fItag\fP or \fB\-\-tag=\fP\fItag\fP"
1495 The
1496 .B "\-t"
1497 option, followed immediately by a TAG,
1498 will edit the file containing that tag.
1499 For this to work, tag information must be available;
1500 for example, there may be a file in the current directory called "tags",
1501 which was previously built by
1502 .BR ctags (1)
1503 or an equivalent command.
1504 If the environment variable LESSGLOBALTAGS is set, it is taken to be
1505 the name of a command compatible with
1506 .BR global (1),
1507 and that command is executed to find the tag.
1508 (See
1509 .nh
1510 http://\*:www\*:.gnu\*:.org/\*:software/\*:global/\*:global\*:.html).
1511 .hy
1512 The
1513 .B "\-t"
1514 option may also be specified from within
1515 .B less
1516 (using the \- command) as a way of examining a new file.
1517 The command ":t" is equivalent to specifying
1518 .B "\-t"
1519 from within
1520 .BR less .
1521 .IP "\fB\-T\fP\fItagsfile\fP or \fB\-\-tag\-file=\fP\fItagsfile\fP"
1522 Specifies a tags file to be used instead of "tags".
1523 .IP "\fB\-u\fP or \fB\-\-underline\-special\fP"
1524 Causes backspaces and carriage returns to be treated as printable characters;
1525 that is, they are sent to the terminal when they appear in the input.
1526 .IP "\fB\-U\fP or \fB\-\-UNDERLINE\-SPECIAL\fP"
1527 Causes backspaces, tabs, carriage returns and "formatting characters"
1528 (as defined by Unicode) to be treated as control characters;
1529 that is, they are handled as specified by the
1530 .B "\-r"
1531 option.
1532 .IP
1533 By default, if neither
1534 .B "\-u"
1535 nor
1536 .B "\-U"
1537 is given,
1538 backspaces which appear adjacent to an underscore character
1539 are treated specially:
1540 the underlined text is displayed
1541 using the terminal's hardware underlining capability.
1542 Also, backspaces which appear between two identical characters
1543 are treated specially:
1544 the overstruck text is printed
1545 using the terminal's hardware boldface capability.
1546 Other backspaces are deleted, along with the preceding character.
1547 Carriage returns immediately followed by a newline are deleted.
1548 Other carriage returns are handled as specified by the
1549 .B "\-r"
1550 option.
1551 Unicode formatting characters, such as the Byte Order Mark,
1552 are sent to the terminal.
1553 Text which is overstruck or underlined can be searched for
1554 if neither
1555 .B "\-u"
1556 nor
1557 .B "\-U"
1558 is in effect.
1559 .IP
1560 See also the
1561 .BR "\-\-proc\-backspace" "," "\-\-proc\-tab" ", and " "\-\-proc\-return"
1562 options.
1563 .IP "\fB\-V\fP or \fB\-\-version\fP"
1564 Displays the version number of
1565 .BR less .
1566 .IP "\fB\-w\fP or \fB\-\-hilite\-unread\fP"
1567 Temporarily highlights the first "new" line after a forward movement
1568 of a full page.
1569 The first "new" line is the line immediately following the line previously
1570 at the bottom of the screen.
1571 Also highlights the target line after a g or p command.
1572 The highlight is removed at the next command which causes movement.
1573 If the
1574 .B "\-\-status\-line"
1575 option is in effect, the entire line
1576 (the width of the screen) is highlighted.
1577 Otherwise, only the text in the line is highlighted,
1578 unless the
1579 .B "\-J"
1580 option is in effect,
1581 in which case only the status column is highlighted.
1582 .IP "\fB\-W\fP or \fB\-\-HILITE\-UNREAD\fP"
1583 Like
1584 .BR "\-w" ","
1585 but temporarily highlights the first new line after any
1586 forward movement command larger than one line.
1587 .IP "\fB\-x\fP\fIn\fP,...\& or \fB\-\-tabs=\fP\fIn\fP,..."
1588 Sets tab stops.
1589 If only one \fIn\fP is specified, tab stops are set at multiples of \fIn\fP.
1590 If multiple values separated by commas are specified, tab stops
1591 are set at those positions, and then continue with the same spacing as the
1592 last two.
1593 For example,
1594 .RB "\[dq]" "\-x9,17" "\[dq]"
1595 will set tabs at positions 9, 17, 25, 33, etc.
1596 The default for \fIn\fP is 8.
1597 .IP "\fB\-X\fP or \fB\-\-no\-init\fP"
1598 Disables sending the termcap initialization and deinitialization strings
1599 to the terminal.
1600 This is sometimes desirable if initialization or deinitialization does
1601 something unnecessary, like clearing the screen.
1602 Note that some terminals require the initialization string for proper
1603 operation, so they may not behave completely correctly when
1604 .B "\-X"
1605 is used.
1606 .IP "\fB\-y\fP\fIn\fP or \fB\-\-max\-forw\-scroll=\fP\fIn\fP"
1607 Specifies a maximum number of lines to scroll forward.
1608 If it is necessary to scroll forward more than \fIn\fP lines,
1609 the screen is repainted instead.
1610 The
1611 .B "\-c"
1612 or
1613 .B "\-C"
1614 option may be used to repaint from the top of
1615 the screen if desired.
1616 By default, any forward movement causes scrolling.
1617 .IP "\fB\-z\fP\fIn\fP or \fB\-\-window=\fP\fIn\fP or \-\fIn\fP"
1618 Changes the default scrolling window size to \fIn\fP lines.
1619 The default is one screenful.
1620 The z and w commands can also be used to change the window size.
1621 The "z" may be omitted for compatibility with some versions of
1622 .BR more (1).
1623 If the number
1624 .I n
1625 is negative, it indicates
1626 .I n
1627 lines less than the current screen size.
1628 For example, if the screen is 24 lines,
1629 .B "\-z\-4"
1630 sets the
1631 scrolling window to 20 lines. If the screen is resized to 40 lines,
1632 the scrolling window automatically changes to 36 lines.
1633 .IP "\fB\-""\fP\fIcc\fP\ or\ \fB\-\-quotes=\fP\fIcc\fP"
1634 Changes the filename quoting character.
1635 This may be necessary if you are trying to name a file
1636 which contains both spaces and quote characters.
1637 Followed by a single character, this changes the quote character to that
1638 character.
1639 Filenames containing a space should then be surrounded by that character
1640 rather than by double quotes.
1641 Followed by two characters, changes the open quote to the first character,
1642 and the close quote to the second character.
1643 Filenames containing a space should then be preceded by the open quote
1644 character and followed by the close quote character.
1645 Note that even after the quote characters are changed, this option
1646 remains \-" (a dash followed by a double quote).
1647 .IP "\fB\-\*~\fP or \fB\-\-tilde\fP"
1648 Normally lines after end of file are displayed as a single tilde (\*~).
1649 This option causes lines after end of file to be displayed as blank lines.
1650 .IP "\fB\-#\fP or \fB\-\-shift\fP"
1651 Specifies the default number of positions to scroll horizontally
1652 in the RIGHTARROW and LEFTARROW commands.
1653 If the number specified is zero, it sets the default number of
1654 positions to one half of the screen width.
1655 Alternately, the number may be specified as a fraction of the width
1656 of the screen, starting with a decimal point: \&.5 is half of the
1657 screen width, \&.3 is three tenths of the screen width, and so on.
1658 If the number is specified as a fraction, the actual number of
1659 scroll positions is recalculated if the terminal window is resized.
1660 .IP "\fB\-\-autosave=\fP\fIactions\fP
1661 Normally the history file is saved only when
1662 .B less
1663 exits.
1664 This option specifies other actions which will cause the history file to be saved.
1665 Each action is defined by a single character in the \fIactions\fP string:
1666 .RS
1667 .IP "m"
1668 Setting or clearing a mark while
1669 .B "\-\-save-marks"
1670 is in effect.
1671 .IP "/"
1672 Searching.
1673 .IP "!"
1674 Running a shell command.
1675 .IP "*"
1676 Any action; same as "m/!".
1677 .RE
1678 .IP
1679 Can be set to "-" to specify the default, that only exiting
1680 .B less
1681 will cause the history file to be saved.
1682 Note that, depending on your shell, if you specify this option on the
1683 command line, the "!" and "*" characters may need to be escaped or quoted.
1684 .IP "\fB\-\-cmd=\fP\fIcommands\fP
1685 The specified string is taken to be an initial command to
1686 .BR less .
1687 This is similar to specifying "+\fIcommands\fP", except that
1688 commands specified by
1689 .B "\-\-cmd"
1690 are not executed if
1691 .B less
1692 exits immediately due to the use of the
1693 .B "\-E"
1694 or
1695 .B "\-F"
1696 option, while
1697 commands specified by the \fB+\fP option are executed even if
1698 .B less
1699 exits immediately.
1700 .IP "\fB\-\-exit\-follow\-on\-close\fP"
1701 When using the "F" command on a pipe,
1702 .B less
1703 will automatically stop waiting for more data when the input side of the
1704 pipe is closed.
1705 .IP "\fB\-\-file\-size\fP"
1706 If
1707 .B "\-\-file\-size"
1708 is specified,
1709 .B less
1710 will determine the size of the file
1711 immediately after opening the file.
1712 Then the "=" command will display the number of lines in the file.
1713 Normally this is not done, because it can be slow if the input file
1714 is non-seekable (such as a pipe) and is large.
1715 .IP "\fB\-\-follow\-name\fP"
1716 Normally, if the input file is renamed while an F command is executing,
1717 .B less
1718 will continue to display the contents of the original file despite
1719 its name change.
1720 If
1721 .B "\-\-follow\-name"
1722 is specified, during an F command
1723 .B less
1724 will periodically attempt to reopen the file by name.
1725 If the reopen succeeds and the file is a different file from the original
1726 (which means that a new file has been created
1727 with the same name as the original (now renamed) file),
1728 .B less
1729 will display the contents of that new file.
1730 .IP "\fB\-\-form\-feed\fP"
1731 When scrolling forward or backward in the file,
1732 stop if a line beginning with a form feed character (\*^L) is reached.
1733 This can be useful when viewing a file which uses form feeds between pages.
1734 .IP "\fB\-\-header=\fP\fIL\fP,\fIC\fP,\fIN\fP"
1735 .RS
1736 Sets the number of header lines and columns displayed on the screen.
1737 The number of header lines is set to \fIL\fP.
1738 If \fIL\fP is 0, header lines are disabled.
1739 If \fIL\fP is empty or missing, the number of header lines is unchanged.
1740 The number of header columns is set to \fIC\fP.
1741 If \fIC\fP is 0, header columns are disabled.
1742 If \fIC\fP is empty or missing, the number of header columns is unchanged.
1743 The first header line is set to line number \fIN\fP in the file.
1744 If \fIN\fP is empty or missing, it is taken to be
1745 the number of the line currently displayed in the first line of the screen
1746 (if the
1747 .B "\-\-header"
1748 command has been issued from within
1749 .BR less "),"
1750 or 1 (if the
1751 .B "\-\-header"
1752 option has been given on the command line).
1753 The special form
1754 .RB "\[dq]" "\-\-header=\-" "\[dq]"
1755 disables header lines and header columns,
1756 and is equivalent to
1757 .RB "\[dq]" "\-\-header=0,0" "\[dq]."
1758 .PP
1759 When \fIL\fP is nonzero, the first \fIL\fP lines at the top
1760 of the screen are replaced with the \fIL\fP lines of the file beginning at line \fIN\fP,
1761 regardless of what part of the file is being viewed.
1762 When header lines are displayed, any file contents before the header line cannot be viewed.
1763 When \fIC\fP is nonzero, the first \fIC\fP characters displayed at the
1764 beginning of each line are replaced with the first \fIC\fP characters of the line,
1765 even if the rest of the line is scrolled horizontally.
1766 .PP
1767 While the
1768 .B "\-\-header"
1769 option is active,
1770 lines longer than the screen width are truncated,
1771 and the
1772 .B "\-S"
1773 option is ignored.
1774 .RE
1775 .IP "\fB\-\-incsearch\fP"
1776 Subsequent search commands will be "incremental"; that is,
1777 .B less
1778 will advance to the next line containing the search pattern
1779 as each character of the pattern is typed in.
1780 .IP "\fB\-\-intr=\fP\fIc\fP"
1781 Use the character \fIc\fP instead of \*^X to interrupt a read
1782 when the "Waiting for data" message is displayed.
1783 \fIc\fP must be an ASCII character; that is, one with a value
1784 between 1 and 127 inclusive.
1785 A caret followed by a single character can be used
1786 to specify a control character.
1787 .IP "\fB\-\-line\-num\-width=\fP\fIn\fP"
1788 Sets the minimum width of the line number field when the \-N option is in effect
1789 to \fIn\fP characters.
1790 The default is 7.
1791 .IP "\fB\-\-match\-shift=\fP\fIn\fP"
1792 When
1793 .B "\-S"
1794 is in effect, if a search match is not visible
1795 because it is shifted to the left or right of the currently
1796 visible screen, the text will horizontally shift
1797 to ensure that the search match is visible.
1798 This option selects the column in which the first character
1799 of the search match will be placed after the shift.
1800 In other words, there will be \fIn\fP characters visible
1801 to the left of the search match.
1802 .IP
1803 Alternately, the number may be specified as a fraction of the width
1804 of the screen, starting with a decimal point: \&.5 is half of the
1805 screen width, \&.3 is three tenths of the screen width, and so on.
1806 If the number is specified as a fraction, the actual number of
1807 scroll positions is recalculated if the terminal window is resized.
1808 .IP "\fB\-\-modelines=\fP\fIn\fP"
1809 .RS
1810 Before displaying a file,
1811 .B less
1812 will read the first \fIn\fP lines to try to find a vim-compatible
1813 .IR modeline .
1814 If \fIn\fP is zero,
1815 .B less
1816 does not try to find modelines.
1817 By using a modeline, the file itself can specify the tab stops
1818 that should be used when viewing it.
1819 .PP
1820 A modeline contains, anywhere in the line,
1821 a program name ("vi", "vim", "ex", or "less"),
1822 followed by a colon,
1823 possibly followed by the word "set",
1824 and finally followed by zero or more option settings.
1825 If the word "set" is used,
1826 option settings are separated by spaces, and end at the first colon.
1827 If the word "set" is not used,
1828 option settings may be separated by either spaces or colons.
1829 The word "set" is required if the program name is "less"
1830 but optional if any of the other three names are used.
1831 If any option setting is of the form "tabstop=\fIn\fP" or "ts=\fIn\fP",
1832 then tab stops are automatically set as if
1833 .BI "\-\-tabs=" "n"
1834 had been given.
1835 See the
1836 .B "\-\-tabs"
1837 description for acceptable values of \fIn\fP.
1838 .RE
1839 .IP "\fB\-\-mouse\fP"
1840 Enables mouse input:
1841 scrolling the mouse wheel down moves forward in the file,
1842 scrolling the mouse wheel up moves backwards in the file,
1843 left-click sets the "#" mark to the line where the mouse is clicked,
1844 and right-click (or any other) returns to the "#" mark position.
1845 Holding down the left button and dragging also moves in the file.
1846 If a left-click is performed with the mouse cursor on an OSC 8 hyperlink,
1847 the hyperlink is selected as if by the \*^O\*^N command.
1848 If a left-click is performed with the mouse cursor on an OSC 8 hyperlink
1849 which is already selected, the hyperlink is opened as if by the \*^O\*^O command.
1850 The number of lines to scroll when the wheel is moved
1851 can be set by the
1852 .B "\-\-wheel\-lines"
1853 option.
1854 Mouse input works only on terminals which support X11 mouse reporting,
1855 and on Windows.
1856 .IP "\fB\-\-MOUSE\fP"
1857 Like
1858 .BR "\-\-mouse" ","
1859 except the direction scrolled
1860 on mouse wheel movement is reversed.
1861 .IP "\fB\-\-no\-edit\-warn\fP"
1862 Don't print a warning message when using the v command
1863 on a file which was opened using a LESSOPEN preprocessor
1864 (see the INPUT PREPROCESSOR section below).
1865 .IP "\fB\-\-no\-keypad\fP"
1866 Disables sending the keypad initialization and deinitialization strings
1867 to the terminal.
1868 This is sometimes useful if the keypad strings make the numeric
1869 keypad behave in an undesirable manner.
1870 .IP "\fB\-\-no\-histdups\fP"
1871 This option changes the behavior so that if a search string or
1872 file name is typed in, and the same string is already in the history list,
1873 the existing copy is removed from the history list before the new one is added.
1874 Thus, a given string will appear only once in the history list.
1875 Normally, a string may appear multiple times.
1876 .IP "\fB\-\-no\-number\-headers\fP"
1877 Header lines (defined via the
1878 .B "\-\-header"
1879 option) are not assigned line numbers.
1880 Line number 1 is assigned to the first line after any header lines.
1881 .IP "\fB\-\-no\-paste\fP"
1882 If the terminal supports
1883 .BR xterm -compatible
1884 "bracketed paste", any text pasted into
1885 .B less
1886 is ignored, except that one line of text may be pasted into the command line
1887 at the bottom of the screen (search strings, file names, etc).
1888 That is, the first newline of text pasted into the command line
1889 and any text that follows it is ignored.
1890 .IP "\fB\-\-no\-search\-header\-lines\fP"
1891 Searches do not include header lines, but still include header columns.
1892 .IP "\fB\-\-no\-search\-header\-columns\fP"
1893 Searches do not include header columns, but still include header lines.
1894 .IP "\fB\-\-no\-search\-headers\fP"
1895 Searches do not include header lines or header columns.
1896 .IP "\fB\-\-no\-vbell\fP"
1897 Disables the terminal's visual bell.
1898 .IP "\fB\-\-proc\-backspace\fP"
1899 If set, backspaces are handled as if neither the
1900 .B "\-u"
1901 option
1902 nor the
1903 .B "\-U"
1904 option were set.
1905 That is, a backspace adjacent to an underscore causes text to be
1906 displayed in underline mode, and a backspace between identical
1907 characters cause text to be displayed in boldface mode.
1908 This option overrides the
1909 .B "\-u"
1910 and
1911 .B "\-U"
1912 options, so that display of
1913 backspaces can be controlled separate from tabs and carriage returns.
1914 If not set, backspace display is controlled by the
1915 .B "\-u"
1916 and
1917 .B "\-U"
1918 options.
1919 .IP "\fB\-\-PROC\-BACKSPACE\fP"
1920 If set, backspaces are handled as if the
1921 .B "\-U"
1922 option were set;
1923 that is backspaces are treated as control characters.
1924 .IP "\fB\-\-proc\-return\fP"
1925 If set, carriage returns are handled as if neither the
1926 .B "\-u"
1927 option
1928 nor the
1929 .B "\-U"
1930 option were set.
1931 That is, a carriage return immediately before a newline is deleted.
1932 This option overrides the
1933 .B "\-u"
1934 and
1935 .B "\-U"
1936 options, so that display of
1937 carriage returns can be controlled separate from that of backspaces and tabs.
1938 If not set, carriage return display is controlled by the
1939 .B "\-u"
1940 and
1941 .B "\-U"
1942 options.
1943 .IP "\fB\-\-PROC\-RETURN\fP"
1944 If set, carriage returns are handled as if the
1945 .B "\-U"
1946 option were set;
1947 that is carriage returns are treated as control characters.
1948 .IP "\fB\-\-proc\-tab\fP"
1949 If set, tabs are handled as if the
1950 .B "\-U"
1951 option were not set.
1952 That is, tabs are expanded to spaces.
1953 This option overrides the
1954 .B "\-U"
1955 option, so that display of
1956 tabs can be controlled separate from that of backspaces and carriage returns.
1957 If not set, tab display is controlled by the
1958 .B "\-U"
1959 option.
1960 .IP "\fB\-\-PROC\-TAB\fP"
1961 If set, tabs are handled as if the
1962 .B "\-U"
1963 option were set;
1964 that is tabs are treated as control characters.
1965 .IP "\fB\-\-redraw\-on\-quit\fP"
1966 When quitting, after sending the terminal deinitialization string,
1967 redraws the entire last screen.
1968 On terminals whose terminal deinitialization string causes the
1969 terminal to switch from an alternate screen,
1970 this makes the last screenful of the current file remain visible after
1971 .B less
1972 has quit.
1973 .IP "\fB\-\-rscroll=\fP\fIc\fP"
1974 This option changes the character used to mark truncated lines.
1975 It may begin with a two-character attribute indicator like LESSBINFMT does.
1976 If there is no attribute indicator, standout is used.
1977 If set to "\-", truncated lines are not marked.
1978 .IP "\fB\-\-save\-marks\fP"
1979 Save marks in the history file, so marks are retained
1980 across different invocations of
1981 .BR less .
1982 .IP "\fB\-\-search\-options=\fP\fI...\fP"
1983 Sets default search modifiers.
1984 The value is a string of one or more of the characters
1985 E, F, K, N, R or W.
1986 Setting any of these has the same effect as typing that
1987 control character at the beginning of every search pattern.
1988 For example, setting
1989 .B "\-\-search\-options=\fIW\fP"
1990 is the same as
1991 typing \*^W at the beginning of every pattern.
1992 The value may also contain a digit between 1 and 5,
1993 which has the same effect as typing \*^S followed by that digit
1994 at the beginning of every search pattern.
1995 The value "\-" disables all default search modifiers.
1996 .IP "\fB\-\-show\-preproc\-errors\fP"
1997 If a LESSOPEN preprocessor produces data,
1998 then exits with a non-zero exit code,
1999 .B less
2000 will display a warning.
2001 .IP "\fB\-\-status\-col\-width=\fP\fIn\fP"
2002 Sets the width of the status column when the
2003 .B "\-J"
2004 option is in effect.
2005 The default is 2 characters.
2006 .IP "\fB\-\-status\-line\fP"
2007 If a line is marked, the entire line (rather than just the status column)
2008 is highlighted.
2009 Also lines highlighted due to the
2010 .B "\-w"
2011 option will have
2012 the entire line highlighted.
2013 If
2014 .B "\-\-use\-color"
2015 is set, the line is colored rather than highlighted.
2016 .IP "\fB\-\-use\-backslash\fP"
2017 This option changes the interpretations of options which follow this one.
2018 After the
2019 .B "\-\-use\-backslash"
2020 option, any backslash in an option string is
2021 removed and the following character is taken literally.
2022 This allows a dollar sign to be included in option strings.
2023 .IP "\fB\-\-use\-color\fP"
2024 Enables colored text in various places.
2025 The
2026 .B "\-D"
2027 option can be used to change the colors.
2028 Colored text works only if the terminal supports
2029 ANSI color escape sequences (as defined in
2030 .nh
2031 https://\*:www\*:.ecma\-international\*:.org/\*:publications\-and\-standards/\*:standards/\*:ecma\-48).
2032 .hy
2033 .IP "\fB\-\-wheel\-lines=\fP\fIn\fP"
2034 Set the number of lines to scroll when the mouse wheel is scrolled
2035 and the
2036 .B "\-\-mouse"
2037 or
2038 .B "\-\-MOUSE"
2039 option is in effect.
2040 The default is 1 line.
2041 .IP "\fB\-\-wordwrap\fP"
2042 When the
2043 .B "\-S"
2044 option is not in use,
2045 wrap each line at a space or tab if possible,
2046 so that a word is not split between two lines.
2047 The default is to wrap at any character.
2048 .IP \fB\-\-\fP
2049 A command line argument of
2050 .RB "\[dq]" "\-\-" "\[dq]"
2051 marks the end of option arguments.
2052 Any arguments following this are interpreted as filenames.
2053 This can be useful when viewing a file whose name begins with a "\-" or "+".
2054 Otherwise, option arguments and filename arguments can be intermixed;
2055 that is, option arguments do not need to appear before filename arguments,
2056 unless the environment variable POSIXLY_CORRECT is set.
2057 .IP +
2058 If a command line option begins with \fB+\fP,
2059 the remainder of that option is taken to be an initial command to
2060 .BR less .
2061 For example, +G tells
2062 .B less
2063 to start at the end of the file rather than the beginning,
2064 and +/xyz tells it to start at the first occurrence of "xyz" in the file.
2065 As a special case, +<number> acts like +<number>g;
2066 that is, it starts the display at the specified line number
2067 (however, see the caveat under the "g" command above).
2068 If the option starts with ++, the initial command applies to
2069 every file being viewed, not just the first one.
2070 The + command described previously
2071 may also be used to set (or change) an initial command for every file.
2072 Also see the
2073 .B "\-\-cmd"
2074 option.
2075 .
2076 .SH "LINE EDITING"
2077 When entering a command line at the bottom of the screen
2078 (for example, a filename for the :e command,
2079 or the pattern for a search command),
2080 certain keys can be used to manipulate the command line.
2081 Most commands have an alternate form in [ brackets ] which can be used if
2082 a key does not exist on a particular keyboard.
2083 (Note that the forms beginning with ESC do not work
2084 on some MS-DOS and Windows systems because ESC is the line erase character.)
2085 Any of these special keys may be entered literally by preceding
2086 it with the "literal" character, either \*^V or \*^A.
2087 A backslash itself may also be entered literally by entering two backslashes.
2088 .IP "LEFTARROW [ ESC-h ]"
2089 Move the cursor one space to the left.
2090 .IP "RIGHTARROW [ ESC-l ]"
2091 Move the cursor one space to the right.
2092 .IP "\*^LEFTARROW [ ESC-b or ESC-LEFTARROW ]"
2093 (That is, CONTROL and LEFTARROW simultaneously.)
2094 Move the cursor one word to the left.
2095 .IP "\*^RIGHTARROW [ ESC-w or ESC-RIGHTARROW ]"
2096 (That is, CONTROL and RIGHTARROW simultaneously.)
2097 Move the cursor one word to the right.
2098 .IP "HOME [ ESC-0 ]"
2099 Move the cursor to the beginning of the line.
2100 .IP "END [ ESC-$ ]"
2101 Move the cursor to the end of the line.
2102 .IP "BACKSPACE"
2103 Delete the character to the left of the cursor,
2104 or cancel the command if the command line is empty.
2105 .IP "DELETE or [ ESC-x ]"
2106 Delete the character under the cursor.
2107 .IP "\*^BACKSPACE [ ESC-BACKSPACE ]"
2108 (That is, CONTROL and BACKSPACE simultaneously.)
2109 Delete the word to the left of the cursor.
2110 .IP "\*^DELETE [ ESC-X or ESC-DELETE ]"
2111 (That is, CONTROL and DELETE simultaneously.)
2112 Delete the word under the cursor.
2113 .IP "UPARROW [ ESC-k ]"
2114 Retrieve the previous command line.
2115 If you first enter some text and then press UPARROW,
2116 it will retrieve the previous command which begins with that text.
2117 .IP "DOWNARROW [ ESC-j ]"
2118 Retrieve the next command line.
2119 If you first enter some text and then press DOWNARROW,
2120 it will retrieve the next command which begins with that text.
2121 .IP "TAB"
2122 Complete the partial filename to the left of the cursor.
2123 If it matches more than one filename, the first match
2124 is entered into the command line.
2125 Repeated TABs will cycle thru the other matching filenames.
2126 If the completed filename is a directory, a "/" is appended to the filename.
2127 (On MS-DOS and Windows systems, a "\e" is appended.)
2128 The environment variable LESSSEPARATOR can be used to specify a
2129 different character to append to a directory name.
2130 .IP "BACKTAB (SHIFT-TAB) [ ESC-TAB ]"
2131 Like TAB, but cycles in the reverse direction thru the matching filenames.
2132 .IP "\*^L"
2133 Complete the partial filename to the left of the cursor.
2134 If it matches more than one filename, all matches are entered into
2135 the command line (if they fit).
2136 .IP "\*^U (Unix and OS/2) or ESC (MS-DOS and Windows)"
2137 Delete the entire command line,
2138 or cancel the command if the cursor is at the beginning of the command line.
2139 If you have changed your line-kill character in Unix to something
2140 other than \*^U, that character is used instead of \*^U.
2141 .IP "\*^G"
2142 Delete the entire command line and return to the main prompt.
2143 .
2144 .SH "KEY BINDINGS"
2145 You may define your own
2146 .B less
2147 commands by creating a lesskey source file.
2148 This file specifies a set of command keys and an action
2149 associated with each key.
2150 You may also change the line-editing keys (see LINE EDITING),
2151 and set environment variables used by
2152 .BR less .
2153 See the
2154 .BR lesskey (1)
2155 manual page for details about the file format.
2156 .PP
2157 If the environment variable LESSKEYIN is set,
2158 .B less
2159 uses that as the name of the lesskey source file.
2160 Otherwise,
2161 .B less
2162 looks in a standard place for the lesskey source file:
2163 On Unix systems,
2164 .B less
2165 looks for a lesskey file called "$XDG_CONFIG_HOME/lesskey" or "$HOME/.config/lesskey" or "$HOME/.lesskey".
2166 On MS-DOS and Windows systems,
2167 .B less
2168 looks for a lesskey file called "$HOME/_lesskey", and if it is not found there,
2169 then looks for a lesskey file called "_lesskey" in any directory specified
2170 in the PATH environment variable.
2171 On OS/2 systems,
2172 .B less
2173 looks for a lesskey file called "$HOME/lesskey.ini", and if it is not found,
2174 then looks for a lesskey file called "lesskey.ini" in any directory specified
2175 in the INIT environment variable, and if it not found there,
2176 then looks for a lesskey file called "lesskey.ini" in any directory specified
2177 in the PATH environment variable.
2178 .PP
2179 A system-wide lesskey source file may also be set up to provide key bindings.
2180 If a key is defined in both a local lesskey file and in the
2181 system-wide file, key bindings in the local file take precedence over
2182 those in the system-wide file.
2183 If the environment variable LESSKEYIN_SYSTEM is set,
2184 .B less
2185 uses that as the name of the system-wide lesskey file.
2186 Otherwise,
2187 .B less
2188 looks in a standard place for the system-wide lesskey file:
2189 On Unix systems, the system-wide lesskey file is /usr/local/etc/syslesskey.
2190 (However, if
2191 .B less
2192 was built with a different sysconf directory than /usr/local/etc,
2193 that directory is where the sysless file is found.)
2194 On MS-DOS and Windows systems, the system-wide lesskey file is c:\e_syslesskey.
2195 On OS/2 systems, the system-wide lesskey file is c:\esyslesskey.ini.
2196 .PP
2197 Older versions of
2198 .B less
2199 (before v582) used lesskey files with a binary format, produced by the
2200 .B lesskey
2201 program. It is no longer necessary to use the
2202 .B lesskey
2203 program.
2204 .
2205 .SH "INPUT PREPROCESSOR"
2206 You may define an "input preprocessor" for
2207 .BR less .
2208 Before
2209 .B less
2210 opens a file, it first gives the input preprocessor a chance to modify the
2211 way the contents of the file are displayed.
2212 An input preprocessor is simply an executable program (or shell script),
2213 which writes the contents of the file to a different file,
2214 called the replacement file.
2215 The contents of the replacement file are then displayed
2216 in place of the contents of the original file.
2217 However, it will appear to the user as if the original file is opened;
2218 that is,
2219 .B less
2220 will display the original filename as the name of the current file.
2221 .PP
2222 An input preprocessor receives one command line argument, the original filename,
2223 as entered by the user.
2224 It should create the replacement file, and when finished,
2225 print the name of the replacement file to its standard output.
2226 If the input preprocessor does not output a replacement filename,
2227 .B less
2228 uses the original file, as normal.
2229 The input preprocessor is not called when viewing standard input.
2230 To set up an input preprocessor, set the LESSOPEN environment variable
2231 to a command line which will invoke your input preprocessor.
2232 This command line should include one occurrence of the string "%s",
2233 which will be replaced by the filename
2234 when the input preprocessor command is invoked.
2235 .PP
2236 When
2237 .B less
2238 closes a file opened in such a way, it will call another program,
2239 called the input postprocessor,
2240 which may perform any desired clean-up action (such as deleting the
2241 replacement file created by LESSOPEN).
2242 This program receives two command line arguments, the original filename
2243 as entered by the user, and the name of the replacement file.
2244 To set up an input postprocessor, set the LESSCLOSE environment variable
2245 to a command line which will invoke your input postprocessor.
2246 It may include two occurrences of the string "%s";
2247 the first is replaced with the original name of the file and
2248 the second with the name of the replacement file,
2249 which was output by LESSOPEN.
2250 .PP
2251 For example, on many Unix systems, these two scripts will allow you
2252 to keep files in compressed format, but still let
2253 .B less
2254 view them directly:
2255 .PP
2256 lessopen.sh:
2257 .br
2258 #! /bin/sh
2259 .br
2260 case "$1" in
2261 .br
2262 *.Z) TEMPFILE=$(mktemp)
2263 .br
2264 uncompress \-c $1 >$TEMPFILE 2>/dev/null
2265 .br
2266 if [ \-s $TEMPFILE ]; then
2267 .br
2268 echo $TEMPFILE
2269 .br
2270 else
2271 .br
2272 rm \-f $TEMPFILE
2273 .br
2274 fi
2275 .br
2276 ;;
2277 .br
2278 esac
2279 .PP
2280 lessclose.sh:
2281 .br
2282 #! /bin/sh
2283 .br
2284 rm $2
2285 .PP
2286 To use these scripts, put them both where they can be executed and
2287 set LESSOPEN="lessopen.sh\ %s", and
2288 LESSCLOSE="lessclose.sh\ %s\ %s".
2289 More complex LESSOPEN and LESSCLOSE scripts may be written
2290 to accept other types of compressed files, and so on.
2291 .PP
2292 It is also possible to set up an input preprocessor to
2293 pipe the file data directly to
2294 .BR less ,
2295 rather than putting the data into a replacement file.
2296 This avoids the need to decompress the entire file before
2297 starting to view it.
2298 An input preprocessor that works this way is called an input pipe.
2299 An input pipe, instead of writing the name of a replacement file on
2300 its standard output,
2301 writes the entire contents of the replacement file on its standard output.
2302 If the input pipe does not write any characters on its standard output,
2303 then there is no replacement file and
2304 .B less
2305 uses the original file, as normal.
2306 To use an input pipe,
2307 make the first character in the LESSOPEN environment variable a
2308 vertical bar (|) to signify that the input preprocessor is an input pipe.
2309 As with non-pipe input preprocessors, the command string must contain one
2310 occurrence of %s, which is replaced with the filename of the input file.
2311 .PP
2312 For example, on many Unix systems, this script will work like the
2313 previous example scripts:
2314 .PP
2315 lesspipe.sh:
2316 .br
2317 #! /bin/sh
2318 .br
2319 case "$1" in
2320 .br
2321 *.Z) uncompress \-c $1 2>/dev/null
2322 .br
2323 ;;
2324 .br
2325 *) exit 1
2326 .br
2327 ;;
2328 .br
2329 esac
2330 .br
2331 exit $?
2332 .br
2333 .PP
2334 To use this script, put it where it can be executed and set
2335 LESSOPEN="|lesspipe.sh %s".
2336 .PP
2337 Note that a preprocessor cannot output an empty file, since that
2338 is interpreted as meaning there is no replacement, and
2339 the original file is used.
2340 To avoid this, if LESSOPEN starts with two vertical bars,
2341 the exit status of the script determines the behavior when the output is empty.
2342 If the output is empty and the exit status is zero,
2343 the empty output is considered to be replacement text.
2344 If the output is empty and the exit status is nonzero,
2345 the original file is used.
2346 For compatibility with previous versions of
2347 .BR less ,
2348 if LESSOPEN starts with only one vertical bar, the exit status
2349 of the preprocessor is ignored.
2350 .PP
2351 When an input pipe is used, a LESSCLOSE postprocessor can be used,
2352 but it is usually not necessary since there is no replacement file
2353 to clean up.
2354 In this case, the replacement file name passed to the LESSCLOSE
2355 postprocessor is "\-".
2356 .PP
2357 For compatibility with previous versions of
2358 .BR less ,
2359 the input preprocessor or pipe is not used if
2360 .B less
2361 is viewing standard input.
2362 However, if the first character of LESSOPEN is a dash (\-),
2363 the input preprocessor is used on standard input as well as other files.
2364 In this case, the dash is not considered to be part of
2365 the preprocessor command.
2366 If standard input is being viewed, the input preprocessor is passed
2367 a file name consisting of a single dash.
2368 Similarly, if the first two characters of LESSOPEN are vertical bar and dash
2369 (|\-) or two vertical bars and a dash (||\-),
2370 the input pipe is used on standard input as well as other files.
2371 Again, in this case the dash is not considered to be part of
2372 the input pipe command.
2373 .PP
2374 There are used following files to set up default preprocessor:
2375 .br
2376 /etc/profile.d/less.sh
2377 .br
2378 /etc/profile.d/less.csh
2379 .br
2380 These files set up /usr/bin/lesspipe.sh as a default filter. An user defined
2381 filter can be specified in ~/.lessfilter. This file should have an execute bit
2382 set and accept only one parameter, which represents a filename. If
2383 the user defined filter process the file, zero should be returned. Otherwise
2384 ~/.lessfilter tries to handle the file.
2385
2386 .SH "NATIONAL CHARACTER SETS"
2387 There are five types of characters in the input file:
2388 .IP "normal characters"
2389 can be displayed directly to the screen.
2390 .IP "control characters"
2391 should not be displayed directly, but are expected to be found
2392 in ordinary text files (such as backspace and tab).
2393 .IP "binary characters"
2394 should not be displayed directly and are not expected to be found
2395 in text files.
2396 .IP "composing characters"
2397 are not displayed separately, but modify the display of the
2398 preceding character. (Only when LESSCHARSET is "utf8".)
2399 .IP "deleted characters"
2400 are simply deleted from the input and not displayed.
2401 (Only when LESSCHARSET is "utf8".)
2402 .PP
2403 A "character set" is a description of which of these categories
2404 each character belongs to.
2405 The LESSCHARSET environment variable may be used to select a character set.
2406 Possible values for LESSCHARSET are:
2407 .IP ascii
2408 BS, TAB, NL, CR, and formfeed are control characters,
2409 all chars with values between 32 and 126 are normal,
2410 and all others are binary.
2411 .IP iso8859
2412 Selects an ISO 8859 character set.
2413 This is the same as ASCII, except characters between 160 and 255 are
2414 treated as normal characters.
2415 .IP latin1
2416 Same as iso8859.
2417 .IP latin9
2418 Same as iso8859.
2419 .IP dos
2420 Selects a character set appropriate for MS-DOS.
2421 .IP ebcdic
2422 Selects an EBCDIC character set.
2423 .IP IBM\-1047
2424 Selects an EBCDIC character set used by OS/390 Unix Services.
2425 This is the EBCDIC analogue of latin1. You get similar results
2426 by setting either LESSCHARSET=IBM\-1047 or LC_CTYPE=en_US
2427 in your environment.
2428 .IP koi8\-r
2429 Selects a Russian character set.
2430 .IP next
2431 Selects a character set appropriate for NeXT computers.
2432 .IP utf\-8
2433 Selects the UTF-8 encoding of the ISO 10646 character set.
2434 UTF-8 is special in that it supports multi-byte characters in the input file.
2435 It is the only character set that supports multi-byte characters.
2436 .IP windows
2437 Selects a character set appropriate for Microsoft Windows (cp 1252).
2438 .PP
2439 In rare cases, it may be desired to tailor
2440 .B less
2441 to use a character set other than the ones definable by LESSCHARSET.
2442 In this case, the environment variable LESSCHARDEF can be used
2443 to define a character set.
2444 It should be set to a string where each character in the string represents
2445 one character in the character set.
2446 The character ".\&" is used for a normal character, "c" for control,
2447 and "b" for binary.
2448 A decimal number may be used for repetition.
2449 For example, "bccc4b.\&" would mean character 0 is binary,
2450 1, 2 and 3 are control, 4, 5, 6 and 7 are binary, and 8 is normal.
2451 All characters after the last are taken to be the same as the last,
2452 so characters 9 through 255 would be normal.
2453 (This is an example, and does not necessarily
2454 represent any real character set.)
2455 .PP
2456 This table shows the value of LESSCHARDEF which is equivalent
2457 to each of the possible values for LESSCHARSET:
2458 .
2459 .RS 5m
2460 .TS
2461 l l.
2462 ascii 8bcccbcc18b95.b
2463 dos 8bcccbcc12bc5b95.b.
2464 ebcdic 5bc6bcc7bcc41b.9b7.9b5.b..8b6.10b6.b9.7b
2465 9.8b8.17b3.3b9.7b9.8b8.6b10.b.b.b.
2466 IBM\-1047 4cbcbc3b9cbccbccbb4c6bcc5b3cbbc4bc4bccbc
2467 191.b
2468 iso8859 8bcccbcc18b95.33b.
2469 koi8\-r 8bcccbcc18b95.b128.
2470 latin1 8bcccbcc18b95.33b.
2471 next 8bcccbcc18b95.bb125.bb
2472 .TE
2473 .RE
2474 .PP
2475 If neither LESSCHARSET nor LESSCHARDEF is set,
2476 but any of the strings "UTF\-8", "UTF8", "utf\-8" or "utf8"
2477 is found in the LC_ALL, LC_CTYPE or LANG
2478 environment variables, then the default character set is utf\-8.
2479 .PP
2480 If that string is not found, but your system supports the
2481 .BR setlocale (3)
2482 interface,
2483 .B less
2484 will use setlocale to determine the character set.
2485 setlocale is controlled by setting the LANG or LC_CTYPE environment
2486 variables.
2487 .PP
2488 Finally, if the
2489 .B setlocale
2490 interface is also not available, the default character set is utf\-8.
2491 .PP
2492 Control and binary characters are displayed in standout (reverse video).
2493 Each such character is displayed in caret notation if possible
2494 (e.g.\& \*^A for control-A). Caret notation is used only if
2495 inverting the 0100 bit results in a normal printable character.
2496 Otherwise, the character is displayed as a hex number in angle brackets.
2497 This format can be changed by
2498 setting the LESSBINFMT environment variable.
2499 LESSBINFMT may begin with a "*" and one character to select
2500 the display attribute:
2501 "*k" is blinking, "*d" is bold, "*u" is underlined, "*s" is standout,
2502 and "*n" is normal.
2503 If LESSBINFMT does not begin with a "*", normal attribute is assumed.
2504 The remainder of LESSBINFMT is a string which may include one
2505 printf-style escape sequence (a % followed by x, X, o, d, etc.).
2506 For example, if LESSBINFMT is "*u[%x]", binary characters
2507 are displayed in underlined hexadecimal surrounded by brackets.
2508 The default if no LESSBINFMT is specified is "*s<%02X>".
2509 Warning: the result of expanding the character via LESSBINFMT must
2510 be less than 31 characters.
2511 .PP
2512 When the character set is utf\-8, the LESSUTFBINFMT environment variable
2513 acts similarly to LESSBINFMT but it applies to Unicode code points
2514 that were successfully decoded but are unsuitable for display (e.g.,
2515 unassigned code points).
2516 Its default value is "<U+%04lX>".
2517 Note that LESSUTFBINFMT and LESSBINFMT share their display attribute
2518 setting ("*x") so specifying one will affect both;
2519 LESSUTFBINFMT is read after LESSBINFMT so its setting, if any,
2520 will have priority.
2521 Problematic octets in a UTF-8 file (octets of a truncated sequence,
2522 octets of a complete but non-shortest form sequence, invalid octets,
2523 and stray trailing octets)
2524 are displayed individually using LESSBINFMT so as to facilitate diagnostic
2525 of how the UTF-8 file is ill-formed.
2526 .PP
2527 When the character set is utf\-8, in rare cases it may be desirable to
2528 override the Unicode definition of the type of certain characters.
2529 For example, characters in a Private Use Area are normally treated as binary
2530 characters, but if you are using a custom font with printable characters
2531 in that range, it may be desirable to tell
2532 .B less
2533 to treat such characters as printable.
2534 This can be done by setting the LESSUTFCHARDEF environment variable
2535 to a comma-separated list of
2536 .I "character type"
2537 definitions.
2538 Each character type definition consists of either one hexadecimal codepoint
2539 or a pair of codepoints separated by a dash,
2540 followed by a colon and a type character.
2541 Each hexadecimal codepoint may optionally be preceded by a "U" or "U+".
2542 If a pair of codepoints is given, the type is set for
2543 all characters inclusively between the two values.
2544 If there are multiple comma-separated codepoint values,
2545 they must be in ascending numerical order.
2546 The type character may be one of:
2547 .RS
2548 .IP "p"
2549 A normal printable character.
2550 .IP "w"
2551 A wide (2-space) printable character.
2552 .IP "b"
2553 A binary (non-printable) character.
2554 .IP "c"
2555 A composing (zero width) character.
2556 .IP "d"
2557 A deleted character (deleted from the input and not displayed).
2558 .RE
2559 .PP
2560 For example, setting LESSUTFCHARDEF to
2561 .PP
2562 .EX
2563 .nf
2564 E000\-F8FF:p,F0000\-FFFFD:p,100000\-10FFFD:p
2565 .fi
2566 .EE
2567 .PP
2568 would make all Private Use Area characters be treated as printable.
2569 .PP
2570 By default, emoji modifiers, components and variation selectors
2571 are deleted because many terminals do not display them correctly.
2572 If you use a terminal which does display some or all of them correctly,
2573 you can cause them to be displayed by setting LESSUTFCHARDEF
2574 to treat them as composing characters.
2575 For example, this sets them all to composing characters:
2576 .PP
2577 .EX
2578 .nf
2579 FE00\-FE0F:c,1F3FB\-1F3FF:c,1F9B0\-1F9B3:c,E0100\-E01EF:c
2580 .fi
2581 .EE
2582 .SH "PROMPTS"
2583 The
2584 .B "\-P"
2585 option allows you to tailor the prompt to your preference.
2586 The string given to the
2587 .B "\-P"
2588 option replaces the specified prompt string.
2589 Certain characters in the string are interpreted specially.
2590 The prompt mechanism is rather complicated to provide flexibility,
2591 but the ordinary user need not understand the details of constructing
2592 personalized prompt strings.
2593 .PP
2594 A percent sign followed by a single character is expanded
2595 according to what the following character is.
2596 (References to the input file size below refer to the preprocessed size,
2597 if an input preprocessor is being used.)
2598 .IP "%b\fIX\fP"
2599 Replaced by the byte offset into the current input file.
2600 The b is followed by a single character (shown as \fIX\fP above)
2601 which specifies the line whose byte offset is to be used.
2602 If the character is a "t", the byte offset of the top line in the
2603 display is used,
2604 an "m" means use the middle line,
2605 a "b" means use the bottom line,
2606 a "B" means use the line just after the bottom line,
2607 and a "j" means use the "target" line, as specified by the
2608 .B "\-j"
2609 option.
2610 .IP "%B"
2611 Replaced by the size of the current input file.
2612 .IP "%c"
2613 Replaced by the column number of the text which appears in the first
2614 column of the screen.
2615 .IP "%C"
2616 Replaced by the column number of the text which appears (or would appear) in the last
2617 column of the screen.
2618 .IP "%d\fIX\fP"
2619 Replaced by the page number of a line in the input file.
2620 The line to be used is determined by the \fIX\fP, as with the %b option.
2621 .IP "%D"
2622 Replaced by the number of pages in the input file,
2623 or equivalently, the page number of the last line in the input file.
2624 .IP "%E"
2625 Replaced by the name of the editor (from the VISUAL environment variable,
2626 or the EDITOR environment variable if VISUAL is not defined).
2627 See the discussion of the LESSEDIT feature below.
2628 .IP "%f"
2629 Replaced by the name of the current input file.
2630 .IP "%F"
2631 Replaced by the last component of the name of the current input file.
2632 .IP "%g"
2633 Replaced by the shell-escaped name of the current input file.
2634 This is useful when the expanded string will be used in a shell command,
2635 such as in LESSEDIT.
2636 .IP "%i"
2637 Replaced by the index of the current file in the list of
2638 input files.
2639 .IP "%l\fIX\fP"
2640 Replaced by the line number of a line in the input file.
2641 The line to be used is determined by the \fIX\fP, as with the %b option.
2642 .IP "%L"
2643 Replaced by the line number of the last line in the input file.
2644 .IP "%m"
2645 Replaced by the total number of input files.
2646 .IP "%o"
2647 Replaced by the URI of the currently selected OSC 8 hyperlink,
2648 or a question mark if no hyperlink is selected.
2649 This is used by OSC 8 handlers as explained in the \*^O\*^O command description.
2650 .IP "%p\fIX\fP"
2651 Replaced by the percent into the current input file, based on byte offsets.
2652 The line used is determined by the \fIX\fP as with the %b option.
2653 .IP "%P\fIX\fP"
2654 Replaced by the percent into the current input file, based on line numbers.
2655 The line used is determined by the \fIX\fP as with the %b option.
2656 .IP "%Q"
2657 Replaced by the percent of the last column of text displayed on the screen
2658 compared to the length of the longest line currently displayed
2659 (that is, %C divided by %W).
2660 Note that using this sequence can make displaying the prompt be slower than usual.
2661 .IP "%s"
2662 Same as %B.
2663 .IP "%t"
2664 Causes any trailing spaces to be removed.
2665 Usually used at the end of the string, but may appear anywhere.
2666 .IP "%T"
2667 Normally expands to the word "file".
2668 However if viewing files via a tags list using the
2669 .B "\-t"
2670 option,
2671 it expands to the word "tag".
2672 .IP "%W"
2673 Replaced by the width of the longest line currently displayed on the screen.
2674 Note that using this sequence can make displaying the prompt be slower than usual.
2675 .IP "%x"
2676 Replaced by the name of the next input file in the list.
2677 .PP
2678 If any item is unknown (for example, the file size if input
2679 is a pipe), a question mark is printed instead.
2680 .PP
2681 The format of the prompt string can be changed
2682 depending on certain conditions.
2683 A question mark followed by a single character acts like an "IF":
2684 depending on the following character, a condition is evaluated.
2685 If the condition is true, any characters following the question mark
2686 and condition character, up to a period, are included in the prompt.
2687 If the condition is false, such characters are not included.
2688 A colon appearing between the question mark and the
2689 period can be used to establish an "ELSE": any characters between
2690 the colon and the period are included in the string if and only if
2691 the IF condition is false.
2692 Condition characters (which follow a question mark) may be:
2693 .IP "?a"
2694 True if any characters have been included in the prompt so far.
2695 .IP "?b\fIX\fP"
2696 True if the byte offset of the specified line is known.
2697 .IP "?B"
2698 True if the size of current input file is known.
2699 .IP "?c"
2700 True if the text is horizontally shifted (%c is not zero).
2701 .IP "?d\fIX\fP"
2702 True if the page number of the specified line is known.
2703 .IP "?e"
2704 True if at end-of-file.
2705 .IP "?f"
2706 True if there is an input filename
2707 (that is, if input is not a pipe).
2708 .IP "?l\fIX\fP"
2709 True if the line number of the specified line is known.
2710 .IP "?L"
2711 True if the line number of the last line in the file is known.
2712 .IP "?m"
2713 True if there is more than one input file.
2714 .IP "?n"
2715 True if this is the first prompt in a new input file.
2716 .IP "?p\fIX\fP"
2717 True if the percent into the current input file, based on byte offsets,
2718 of the specified line is known.
2719 .IP "?P\fIX\fP"
2720 True if the percent into the current input file, based on line numbers,
2721 of the specified line is known.
2722 .IP "?Q"
2723 True if %Q is less than 100.
2724 Note that using this sequence can make displaying the prompt be slower than usual.
2725 .IP "?s"
2726 Same as "?B".
2727 .IP "?x"
2728 True if there is a next input file
2729 (that is, if the current input file is not the last one).
2730 .PP
2731 Any characters other than the special ones
2732 (question mark, colon, period, percent, and backslash)
2733 become literally part of the prompt.
2734 Any of the special characters may be included in the prompt literally
2735 by preceding it with a backslash.
2736 .PP
2737 Some examples:
2738 .PP
2739 .EX
2740 ?f%f:Standard input.
2741 .EE
2742 .PP
2743 This prompt prints the filename, if known;
2744 otherwise the string "Standard input".
2745 .PP
2746 .EX
2747 ?f%f \&.?ltLine %lt:?pt%pt\e%:?btByte %bt:\-...
2748 .EE
2749 .PP
2750 This prompt would print the filename, if known.
2751 The filename is followed by the line number, if known,
2752 otherwise the percent if known, otherwise the byte offset if known.
2753 Otherwise, a dash is printed.
2754 Notice how each question mark has a matching period,
2755 and how the % after the %pt
2756 is included literally by escaping it with a backslash.
2757 .PP
2758 .EX
2759 ?n?f%f\ .?m(%T %i of %m)\ ..?e(END)\ ?x\-\ Next\e:\ %x..%t
2760 .EE
2761 .PP
2762 This prints the filename if this is the first prompt in a file,
2763 followed by the "file N of N" message if there is more
2764 than one input file.
2765 Then, if we are at end-of-file, the string "(END)" is printed
2766 followed by the name of the next file, if there is one.
2767 Finally, any trailing spaces are truncated.
2768 This is the default prompt.
2769 For reference, here are the defaults for
2770 the other two prompts
2771 .B "\-m"
2772 and
2773 .B "\-M"
2774 respectively).
2775 Each is broken into two lines here for readability only.
2776 .PP
2777 .EX
2778 .nf
2779 ?n?f%f\ .?m(%T\ %i\ of\ %m)\ ..?e(END)\ ?x\-\ Next\e:\ %x.:
2780 ?pB%pB\e%:byte\ %bB?s/%s...%t
2781 .PP
2782 ?f%f\ .?n?m(%T\ %i\ of\ %m)\ ..?ltlines\ %lt\-%lb?L/%L.\ :
2783 byte\ %bB?s/%s.\ .?e(END)\ ?x\-\ Next\e:\ %x.:?pB%pB\e%..?c\ (column\ %c).%t
2784 .fi
2785 .EE
2786 .PP
2787 And here is the default message produced by the = command:
2788 .PP
2789 .EX
2790 .nf
2791 ?f%f\ .?m(%T\ %i\ of\ %m)\ .?ltlines\ %lt\-%lb?L/%L.\ .
2792 byte\ %bB?s/%s.\ ?e(END)\ :?pB%pB\e%..?c\ (column\ %c).%t
2793 .fi
2794 .EE
2795 .PP
2796 The prompt expansion features are also used for another purpose:
2797 if an environment variable LESSEDIT is defined, it is used
2798 as the command to be executed when the v command is invoked.
2799 The LESSEDIT string is expanded in the same way as the prompt strings.
2800 The default value for LESSEDIT is:
2801 .PP
2802 .EX
2803 .nf
2804 %E\ ?lm+%lm.\ %g
2805 .fi
2806 .EE
2807 .PP
2808 Note that this expands to the editor name, followed by a + and the
2809 line number, followed by the shell-escaped file name.
2810 If your editor does not accept the "+linenumber" syntax, or has other
2811 differences in invocation syntax, the LESSEDIT variable can be
2812 changed to modify this default.
2813 .
2814 .SH SECURITY
2815 When the environment variable LESSSECURE is set to 1,
2816 .B less
2817 runs in a "secure" mode.
2818 In this mode, these features are disabled:
2819 .IP "edit" 10
2820 the edit command (v)
2821 .IP "examine"
2822 the examine command (:e)
2823 .IP "glob"
2824 metacharacters such as * in filenames,
2825 .br
2826 and filename completion (TAB, \*^L)
2827 .IP "history"
2828 history file
2829 .IP "lesskey"
2830 use of lesskey files
2831 .B "\-k"
2832 and
2833 .BR "\-\-lesskey\-src" ")"
2834 .IP "lessopen"
2835 input preprocessor (LESSOPEN environment variable)
2836 .IP "logfile"
2837 log files (s and
2838 .BR "\-o" ")"
2839 .IP "osc8"
2840 opening OSC 8 links (\*^O\*^O)
2841 .IP "pipe"
2842 the pipe command (|)
2843 .IP "shell"
2844 the shell and pshell commands (! and #)
2845 .IP "stop"
2846 stopping
2847 .B less
2848 via a SIGTSTP signal
2849 .IP "tags"
2850 use of tags files
2851 .RB "(" "\-t" ")"
2852 .PP
2853 The LESSSECURE_ALLOW environment variable can be set to a comma-separated list
2854 of names of features which are selectively enabled when LESSSECURE is set.
2855 Each feature name is the first word in each line in the above list.
2856 A feature name may be abbreviated as long as the abbreviation is unambiguous.
2857 For example, if
2858 .nh
2859 LESSSECURE=1
2860 .hy
2861 and
2862 .nh
2863 LESSSECURE_ALLOW=hist,edit
2864 .hy
2865 were set, all of the above features would be disabled
2866 except for history files and the edit command.
2867 .PP
2868 Less can also be compiled to be permanently in "secure" mode.
2869 In that case, the LESSSECURE and LESSSECURE_ALLOW variables are ignored.
2870 .
2871 .SH "COMPATIBILITY WITH MORE"
2872 If the environment variable LESS_IS_MORE is set to 1,
2873 or if the program is invoked via a file link named "more"
2874 and the environment variable LESS_IS_MORE is not set to 0,
2875 .B less
2876 behaves (mostly) in conformance with the POSIX
2877 .BR more (1)
2878 command specification.
2879 In this mode,
2880 .B less
2881 behaves differently in these ways:
2882 .PP
2883 The
2884 .B "\-e"
2885 option works differently.
2886 If the
2887 .B "\-e"
2888 option is not set,
2889 .B less
2890 behaves as if the
2891 .B "\-e"
2892 option were set.
2893 If the
2894 .B "\-e"
2895 option is set,
2896 .B less
2897 behaves as if the
2898 .B "\-E"
2899 option were set.
2900 .PP
2901 The
2902 .B "\-m"
2903 option works differently.
2904 If the
2905 .B "\-m"
2906 option is not set, the medium prompt is used,
2907 and it is prefixed with the string "\-\-More\-\-".
2908 If the
2909 .B "\-m"
2910 option is set, the short prompt is used.
2911 .PP
2912 The
2913 .B "\-n"
2914 option acts like the
2915 .B "\-z"
2916 option.
2917 The normal behavior of the
2918 .B "\-n"
2919 option is unavailable in this mode.
2920 .PP
2921 The parameter to the
2922 .B "\-p"
2923 option is taken to be a
2924 .B less
2925 command rather than a search pattern.
2926 .PP
2927 The LESS environment variable is ignored,
2928 and the MORE environment variable is used in its place.
2929 .
2930 .SH "ENVIRONMENT VARIABLES"
2931 Environment variables may be specified either in the system environment
2932 as usual, or in a
2933 .BR lesskey (1)
2934 file.
2935 If environment variables are defined in more than one place,
2936 variables defined in a local lesskey file take precedence over
2937 variables defined in the system environment, which take precedence
2938 over variables defined in the system-wide lesskey file.
2939 .IP COLUMNS
2940 Sets the number of columns on the screen.
2941 Takes precedence over the number of columns specified by the TERM variable.
2942 (But if you have a windowing system which supports TIOCGWINSZ or WIOCGETD,
2943 the window system's idea of the screen size takes precedence over the
2944 LINES and COLUMNS environment variables.)
2945 .IP EDITOR
2946 The name of the editor (used for the v command).
2947 .IP HOME
2948 Name of the user's home directory
2949 (used to find a lesskey file on Unix and OS/2 systems).
2950 .IP "HOMEDRIVE, HOMEPATH"
2951 Concatenation of the HOMEDRIVE and HOMEPATH environment variables is
2952 the name of the user's home directory if the HOME variable is not set
2953 (only in the Windows version).
2954 .IP INIT
2955 Name of the user's init directory (used to find a lesskey file on OS/2 systems).
2956 .IP LANG
2957 Language for determining the character set.
2958 .IP LC_CTYPE
2959 Language for determining the character set.
2960 .IP LESS
2961 Options which are passed to
2962 .B less
2963 automatically.
2964 .IP LESSANSIENDCHARS
2965 Characters which may end an ANSI color escape sequence
2966 (default "m").
2967 .IP LESSANSIMIDCHARS
2968 Characters which may appear between the ESC character and the
2969 end character in an ANSI color escape sequence
2970 (default "0123456789:;[?!"\*'#%()*+\ ").
2971 .IP LESSANSIOSCALLOW
2972 A comma-separated list of OSC types which are output directly to the
2973 terminal when
2974 .B "\-R"
2975 is in effect
2976 (default "8"; that is, only OSC 8 sequences are output directly).
2977 .IP LESSANSIOSCCHARS
2978 Characters which may follow an ESC character to mark the start
2979 of an "OS Command" sequence.
2980 All characters that follow this character up to a
2981 String Terminator (ESC-backslash or BEL)
2982 are considered to be part of the OSC sequence
2983 (default "]").
2984 If a character in LESSANSIOSCCHARS is followed by an asterisk,
2985 sequences that begin with that character in the file contents
2986 are passed through to the terminal;
2987 otherwise only sequences that appear in a prompt string are passed through.
2988 .IP LESSBINFMT
2989 Format for displaying non-printable, non-control characters.
2990 .IP LESSCHARDEF
2991 Defines a character set.
2992 .IP LESSCHARSET
2993 Selects a predefined character set.
2994 .IP LESSCLOSE
2995 Command line to invoke the (optional) input-postprocessor.
2996 .IP LESSECHO
2997 Name of the lessecho program (default "lessecho").
2998 The lessecho program is needed to expand metacharacters, such as * and ?,
2999 in filenames on Unix systems.
3000 .IP LESSEDIT
3001 Editor prototype string (used for the v command).
3002 See discussion under PROMPTS.
3003 .IP LESSGLOBALTAGS
3004 Name of the command used by the
3005 .B "\-t"
3006 option to find global tags.
3007 Normally should be set to "global" if your system has the
3008 .BR global (1)
3009 command. If not set, global tags are not used.
3010 .IP LESSHISTFILE
3011 Name of the history file used to remember search commands and
3012 shell commands between invocations of
3013 .BR less .
3014 If set to "\-" or "/dev/null", a history file is not used.
3015 The default depends on the operating system, but is usually:
3016 .RS
3017 .IP "Linux and Unix"
3018 "$XDG_STATE_HOME/lesshst" or "$HOME/.local/state/lesshst" or
3019 "$XDG_DATA_HOME/lesshst" or "$HOME/.lesshst".
3020 .IP "Windows and MS-DOS"
3021 "$HOME/_lesshst".
3022 .IP "OS/2"
3023 "$HOME/lesshst.ini" or "$INIT/lesshst.ini".
3024 .RE
3025 .IP LESSHISTSIZE
3026 The maximum number of commands to save in the history file.
3027 The default is 100.
3028 .IP LESSKEYIN
3029 Name of the default
3030 .I "lesskey source"
3031 file.
3032 .IP LESSKEY
3033 Name of the default
3034 .I "lesskey binary"
3035 file. (Not used if "$LESSKEYIN" exists.)
3036 .IP LESSKEY_CONTENT
3037 The value is parsed as if it were the parameter of a
3038 .B "\-\-lesskey\-content"
3039 option.
3040 .IP LESSKEYIN_SYSTEM
3041 Name of the default system-wide
3042 .I "lesskey source"
3043 file.
3044 .IP LESSKEY_SYSTEM
3045 Name of the default system-wide
3046 .I "lesskey binary"
3047 file. (Not used if "$LESSKEYIN_SYSTEM" exists.)
3048 .IP LESSMETACHARS
3049 List of characters which are considered "metacharacters" by the shell.
3050 .IP LESSMETAESCAPE
3051 Prefix which less will add before each metacharacter in a
3052 command sent to the shell (default "\e").
3053 .IP LESSNOCONFIG
3054 If set to "\-", all environment variables except TERM are ignored
3055 (treated as if they were not set).
3056 If set to a comma-separated list of environment variable names,
3057 all environment variables except TERM and those in the list are ignored.
3058 In either case (if set to any non-empty value), all
3059 .B lesskey
3060 files are also ignored.
3061 .IP LESSOPEN
3062 Command line to invoke the (optional) input-preprocessor.
3063 .IP LESSSECURE
3064 Runs less in "secure" mode.
3065 See discussion under SECURITY.
3066 .IP LESSSECURE_ALLOW
3067 Enables individual features which are normally disabled by LESSSECURE.
3068 See discussion under SECURITY.
3069 .IP LESSSEPARATOR
3070 String to be appended to a directory name in filename completion
3071 (default "\e" on MS-DOS, Windows, and OS/2; otherwise "/").
3072 .IP LESSUTFBINFMT
3073 Format for displaying non-printable Unicode code points.
3074 .IP LESSUTFCHARDEF
3075 Overrides the type of specified Unicode characters.
3076 .IP LESS_COLUMNS
3077 Sets the number of columns on the screen.
3078 Unlike COLUMNS, takes precedence over the system's idea of the screen size,
3079 so it can be used to make
3080 .B less
3081 use less than the full screen width.
3082 If set to a negative number, sets the number of columns used to
3083 this much less than the actual screen width.
3084 .IP LESS_LINES
3085 Sets the number of lines on the screen.
3086 Unlike LINES, takes precedence over the system's idea of the screen size,
3087 so it can be used to make
3088 .B less
3089 use less than the full screen height.
3090 If set to a negative number, sets the number of lines used to
3091 this much less than the actual screen height.
3092 When set,
3093 .B less
3094 repaints the entire screen on every movement command,
3095 so scrolling may be slower.
3096 .IP LESS_DATA_DELAY
3097 Duration (in milliseconds) after starting to read data from the input,
3098 after which the "Waiting for data" message will be displayed.
3099 The default is 4000 (4 seconds).
3100 .IP LESS_IS_MORE
3101 Emulate the
3102 .BR more (1)
3103 command.
3104 .IP LESS_OSC8_xxx
3105 Where "xxx" is a URI scheme such as "http" or "file",
3106 sets an OSC 8 handler for opening OSC 8 links containing a URI with that scheme.
3107 .IP LESS_OSC8_ANY
3108 Sets an OSC 8 handler for opening OSC 8 links for which there is
3109 no specific LESS_OSC8_xxx handler set for the "xxx" scheme.
3110 .IP LESS_SHELL_LINES
3111 When the
3112 .B "\-F"
3113 option is set,
3114 .B less
3115 exits automatically if the number of screen lines used to display the file
3116 is less than or equal to the screen height minus the value of
3117 the LESS_SHELL_LINES variable.
3118 Thus, if you use a shell prompt which occupies more than one screen line,
3119 this variable can be set to the number of lines used by your prompt,
3120 to ensure that the entire file can be seen when
3121 .B "\-F"
3122 is used.
3123 If not set, LESS_SHELL_LINES is assumed to be 1.
3124 .IP LESS_SIGUSR1
3125 If set to a string of one or more
3126 .B less
3127 command characters, those commands will be executed when
3128 .B less
3129 receives a SIGUSR1 signal.
3130 .IP LESS_TERMCAP_xx
3131 Where "xx" is any two characters, overrides the definition
3132 of the termcap "xx" capability for the terminal.
3133 No escape sequences in the string are processed, so any
3134 nonprintable characters such as ESC must be in the string literally.
3135 .IP LESS_TERMINFO_xxxx
3136 Where "xxxx" is any string of characters, overrides the definition
3137 of the terminfo "xxxx" capability for the terminal.
3138 You can use either LESS_TERMCAP_xx or LESS_TERMINFO_xxxx to override
3139 a terminal capability, regardless of whether
3140 .B less
3141 is built with the
3142 .B termcap
3143 or the
3144 .B terminfo
3145 library.
3146 .IP LESS_TERMCAP_BRACKETED_PASTE_START
3147 Overrides the standard ANSI escape sequence to enable bracketed paste.
3148 This is used when the
3149 .B "\-\-no\-paste"
3150 option is in effect.
3151 .IP LESS_TERMCAP_BRACKETED_PASTE_END
3152 Overrides the standard ANSI escape sequence to disable bracketed paste.
3153 .IP LESS_TERMCAP_MOUSE_START
3154 Overrides the standard ANSI escape sequence to enable mouse reporting.
3155 This is used when the
3156 .B "\-\-mouse"
3157 option is in effect.
3158 .IP LESS_TERMCAP_MOUSE_END
3159 Overrides the standard ANSI escape sequence to disable mouse reporting.
3160 .IP LESS_TERMCAP_SUSPEND
3161 Defines an escape sequence to temporarily suspend screen updates.
3162 This is sent to the terminal before clearing the screen.
3163 This can be used to avoid screen tearing when the screen is redrawn
3164 on certain terminals.
3165 .IP LESS_TERMCAP_RESUME
3166 Defines an escape sequence to resume screen updates.
3167 This is sent to the terminal after displaying the prompt.
3168 .IP LESS_UNSUPPORT
3169 A space-separated list of command line options.
3170 These options will be ignored (with no error message) if they appear
3171 on the command line or in the LESS environment variable.
3172 Options listed in LESS_UNSUPPORT can still be changed by the \- and \-\- commands.
3173 Each option in LESS_UNSUPPORT is a dash followed by a single character
3174 option letter, or two dashes followed by a long option name.
3175 .IP LINES
3176 Sets the number of lines on the screen.
3177 Takes precedence over the number of lines specified by the TERM variable.
3178 (But if you have a windowing system which supports TIOCGWINSZ or WIOCGETD,
3179 the window system's idea of the screen size takes precedence over the
3180 LINES and COLUMNS environment variables.)
3181 .IP MORE
3182 Options which are passed to
3183 .B less
3184 automatically when running in
3185 .BR more "-compatible mode."
3186 .IP PATH
3187 User's search path (used to find a lesskey file
3188 on MS-DOS, Windows, and OS/2 systems).
3189 .IP POSIXLY_CORRECT
3190 If set to any value, all option arguments on the command line
3191 are expected to appear before any filename arguments.
3192 This must be set as an actual environment variable, not in a
3193 .B lesskey
3194 file.
3195 .IP SHELL
3196 The shell used to execute the !\& command, as well as to expand filenames.
3197 .IP TERM
3198 The type of terminal on which
3199 .B less
3200 is being run.
3201 .IP VISUAL
3202 The name of the editor (used for the v command).
3203 .IP XDG_CONFIG_HOME
3204 Possible location of the
3205 .B lesskey
3206 file; see the KEY BINDINGS section.
3207 .IP XDG_DATA_HOME
3208 Possible location of the history file; see the description of the LESSHISTFILE environment variable.
3209 .IP XDG_STATE_HOME
3210 Possible location of the history file; see the description of the LESSHISTFILE environment variable.
3211 .
3212 .SH "SEE ALSO"
3213 .BR lesskey (1),
3214 .BR lessecho (1)
3215 .
3216 .SH COPYRIGHT
3217 Copyright (C) 1984-2025 Mark Nudelman
3218 .PP
3219 less is part of the GNU project and is free software.
3220 You can redistribute it and/or modify it
3221 under the terms of either
3222 (1) the GNU General Public License as published by
3223 the Free Software Foundation; or (2) the Less License.
3224 See the file README in the less distribution for more details
3225 regarding redistribution.
3226 You should have received a copy of the GNU General Public License
3227 along with the source for less; see the file COPYING.
3228 If not, write to the Free Software Foundation, 59 Temple Place,
3229 Suite 330, Boston, MA 02111-1307, USA.
3230 You should also have received a copy of the Less License;
3231 see the file LICENSE.
3232 .PP
3233 less is distributed in the hope that it will be useful, but
3234 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
3235 or FITNESS FOR A PARTICULAR PURPOSE.
3236 See the GNU General Public License for more details.
3237 .
3238 .SH AUTHOR
3239 .
3240 Mark Nudelman
3241 .br
3242 Report bugs at
3243 .nh
3244 https://\*:github\*:.com/\*:gwsw/\*:less/\*:issues.
3245 .hy
3246 .br
3247 For more information, see the less homepage at
3248 .br
3249 .nh
3250 https://\*:greenwoodsoftware\*:.com/\*:less.
3251 .hy