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