summaryrefslogtreecommitdiffstats
path: root/upstream/debian-unstable/man1/less.1
diff options
context:
space:
mode:
Diffstat (limited to 'upstream/debian-unstable/man1/less.1')
-rw-r--r--upstream/debian-unstable/man1/less.1751
1 files changed, 530 insertions, 221 deletions
diff --git a/upstream/debian-unstable/man1/less.1 b/upstream/debian-unstable/man1/less.1
index 7b633e27..ab0ea975 100644
--- a/upstream/debian-unstable/man1/less.1
+++ b/upstream/debian-unstable/man1/less.1
@@ -1,5 +1,5 @@
'\" t
-.TH LESS 1 "Version 590: 03 Jun 2021"
+.TH LESS 1 "Version 643: 20 Jul 2023"
.SH NAME
less \- opposite of more
.SH SYNOPSIS
@@ -11,7 +11,7 @@ less \- opposite of more
.br
.B "less \-\-version"
.br
-.B "less [\-[+]aABcCdeEfFgGiIJKLmMnNqQrRsSuUVwWX~]"
+.B "less [\-[+]aABcCdeEfFgGiIJKLmMnNqQrRsSuUVwWX\(ti]"
.br
.B " [\-b \fIspace\/\fP] [\-h \fIlines\/\fP] [\-j \fIline\/\fP] [\-k \fIkeyfile\/\fP]"
.br
@@ -24,15 +24,17 @@ less \- opposite of more
(See the OPTIONS section for alternate option syntax with long option names.)
.
.SH DESCRIPTION
-.I Less
+.B Less
is a program similar to
-.IR more (1),
-but it has many more features.
-.I Less
+.BR more (1),
+but which allows backward movement
+in the file as well as forward movement.
+Also,
+.B less
does not have to read the entire input file before starting,
so with large input files it starts up faster than text editors like
-.IR vi (1).
-.I Less
+.BR vi (1).
+.B Less
uses termcap (or terminfo on some systems),
so it can run on a variety of terminals.
There is even limited support for hardcopy terminals.
@@ -40,46 +42,46 @@ There is even limited support for hardcopy terminals.
of the screen are prefixed with a caret.)
.PP
Commands are based on both
-.I more
+.B more
and
-.IR vi .
+.BR vi .
Commands may be preceded by a decimal number,
called N in the descriptions below.
The number is used by some commands, as indicated.
.
.SH COMMANDS
-In the following descriptions, ^X means control-X.
+In the following descriptions, \(haX means control-X.
ESC stands for the ESCAPE key; for example ESC-v means the
two character sequence "ESCAPE", then "v".
.IP "h or H"
Help: display a summary of these commands.
If you forget all the other commands, remember this one.
-.IP "SPACE or ^V or f or ^F"
+.IP "SPACE or \(haV or f or \(haF"
Scroll forward N lines, default one window (see option \-z below).
If N is more than the screen size, only the final screenful is displayed.
-Warning: some systems use ^V as a special literalization character.
+Warning: some systems use \(haV as a special literalization character.
.IP "z"
Like SPACE, but if N is specified, it becomes the new window size.
.IP "ESC-SPACE"
Like SPACE, but scrolls a full screenful, even if it reaches
end-of-file in the process.
-.IP "ENTER or RETURN or ^N or e or ^E or j or ^J"
+.IP "ENTER or RETURN or \(haN or e or \(haE or j or \(haJ"
Scroll forward N lines, default 1.
The entire N lines are displayed, even if N is more than the screen size.
-.IP "d or ^D"
+.IP "d or \(haD"
Scroll forward N lines, default one half of the screen size.
If N is specified, it becomes the new default for
subsequent d and u commands.
-.IP "b or ^B or ESC-v"
+.IP "b or \(haB or ESC-v"
Scroll backward N lines, default one window (see option \-z below).
If N is more than the screen size, only the final screenful is displayed.
.IP "w"
Like ESC-v, but if N is specified, it becomes the new window size.
-.IP "y or ^Y or ^P or k or ^K"
+.IP "y or \(haY or \(haP or k or \(haK"
Scroll backward N lines, default 1.
The entire N lines are displayed, even if N is more than the screen size.
-Warning: some systems use ^Y as a special job control character.
-.IP "u or ^U"
+Warning: some systems use \(haY as a special job control character.
+.IP "u or \(haU"
Scroll backward N lines, default one half of the screen size.
If N is specified, it becomes the new default for
subsequent d and u commands.
@@ -99,11 +101,11 @@ Scroll horizontally left N characters, default half the screen width
(see the \-# option).
If a number N is specified, it becomes the default for future RIGHTARROW
and LEFTARROW commands.
-.IP "ESC-} or ^RIGHTARROW"
+.IP "ESC-} or \(haRIGHTARROW"
Scroll horizontally right to show the end of the longest displayed line.
-.IP "ESC-{ or ^LEFTARROW"
+.IP "ESC-{ or \(haLEFTARROW"
Scroll horizontally left back to the first column.
-.IP "r or ^R or ^L"
+.IP "r or \(haR or \(haL"
Repaint the screen.
.IP R
Repaint the screen, discarding any buffered input.
@@ -116,8 +118,14 @@ Normally this command would be used when already at the end of the file.
It is a way to monitor the tail of a file which is growing
while it is being viewed.
(The behavior is similar to the "tail \-f" command.)
-To stop waiting for more data, enter the interrupt character (usually ^C).
-On some systems you can also use ^X.
+To stop waiting for more data, enter the interrupt character (usually \(haC).
+On systems which support
+.BR poll (2)
+you can also use \(haX or the character specified by the \-\-intr option.
+If the input is a pipe and the \-\-exit-follow-on-close option is in effect,
+.B less
+will automatically stop waiting for data when the input side
+of the pipe is closed.
.IP "ESC-F"
Like F, but as soon as a line is found which matches
the last search pattern, the terminal bell is rung
@@ -152,7 +160,7 @@ on the screen,
the } command will go to the matching left curly bracket.
The matching left curly bracket is positioned on the top
line of the screen.
-If there is more than one right curly bracket on the top line,
+If there is more than one right curly bracket on the bottom line,
a number N may be used to specify the N-th bracket on the line.
.IP "("
Like {, but applies to parentheses rather than curly brackets.
@@ -162,17 +170,17 @@ Like }, but applies to parentheses rather than curly brackets.
Like {, but applies to square brackets rather than curly brackets.
.IP "]"
Like }, but applies to square brackets rather than curly brackets.
-.IP "ESC-^F"
+.IP "ESC-\(haF"
Followed by two characters,
acts like {, but uses the two characters as open and close brackets,
respectively.
-For example, "ESC ^F < >" could be used to
+For example, "ESC \(haF < >" could be used to
go forward to the > which matches the < in the top displayed line.
-.IP "ESC-^B"
+.IP "ESC-\(haB"
Followed by two characters,
acts like }, but uses the two characters as open and close brackets,
respectively.
-For example, "ESC ^B < >" could be used to
+For example, "ESC \(haB < >" could be used to
go backward to the < which matches the > in the bottom displayed line.
.IP m
Followed by any lowercase or uppercase letter,
@@ -182,17 +190,17 @@ the status column shows the marked line.
.IP M
Acts like m, except the last displayed line is marked
rather than the first displayed line.
-.IP "'"
+.IP "\(aq"
(Single quote.)
Followed by any lowercase or uppercase letter, returns to the position which
was previously marked with that letter.
Followed by another single quote, returns to the position at
which the last "large" movement command was executed.
-Followed by a ^ or $, jumps to the beginning or end of the
+Followed by a \(ha or $, jumps to the beginning or end of the
file respectively.
Marks are preserved when a new file is examined,
-so the ' command can be used to switch between input files.
-.IP "^X^X"
+so the \(aq command can be used to switch between input files.
+.IP "\(haX\(haX"
Same as single quote.
.IP "ESC-m"
Followed by any lowercase or uppercase letter,
@@ -202,6 +210,8 @@ Search forward in the file for the N-th line containing the pattern.
N defaults to 1.
The pattern is a regular expression, as recognized by
the regular expression library supplied by your system.
+By default, searching is case-sensitive (uppercase and lowercase
+are considered different); the \-i option can be used to change this.
The search starts at the first line displayed
(but see the \-a and \-j options, which change this).
.sp
@@ -209,29 +219,40 @@ Certain characters are special
if entered at the beginning of the pattern;
they modify the type of search rather than become part of the pattern:
.RS
-.IP "^N or !"
+.IP "\(haN or !"
Search for lines which do NOT match the pattern.
-.IP "^E or *"
+.IP "\(haE or *"
Search multiple files.
That is, if the search reaches the END of the current file
without finding a match,
the search continues in the next file in the command line list.
-.IP "^F or @"
+.IP "\(haF or @"
Begin the search at the first line of the FIRST file
in the command line list,
regardless of what is currently displayed on the screen
or the settings of the \-a or \-j options.
-.IP "^K"
+.IP "\(haK"
Highlight any text which matches the pattern on the current screen,
but don't move to the first match (KEEP current position).
-.IP "^R"
+.IP "\(haR"
Don't interpret regular expression metacharacters;
that is, do a simple textual comparison.
-.IP "^W"
+.IP "\(haS"
+Followed by a digit N between 1 and 5.
+Only text which has a non-empty match for the N-th parenthesized SUB-PATTERN
+will be considered to match the pattern.
+(Supported only if
+.B less
+is built with one of the regular expression libraries
+.BR posix ", " pcre ", or " pcre2 ".)"
+Multiple \(haS modifiers can be specified,
+to match more than one sub-pattern.
+.IP "\(haW"
WRAP around the current file.
That is, if the search reaches the end of the current file
without finding a match, the search continues from the first line of the
current file up to the line where it started.
+If the \(haW modifier is set, the \(haE modifier is ignored.
.RE
.IP ?pattern
Search backward in the file for the N-th line containing the pattern.
@@ -240,23 +261,25 @@ The search starts at the last line displayed
.sp
Certain characters are special as in the / command:
.RS
-.IP "^N or !"
+.IP "\(haN or !"
Search for lines which do NOT match the pattern.
-.IP "^E or *"
+.IP "\(haE or *"
Search multiple files.
That is, if the search reaches the beginning of the current file
without finding a match,
the search continues in the previous file in the command line list.
-.IP "^F or @"
+.IP "\(haF or @"
Begin the search at the last line of the last file
in the command line list,
regardless of what is currently displayed on the screen
or the settings of the \-a or \-j options.
-.IP "^K"
+.IP "\(haK"
As in forward searches.
-.IP "^R"
+.IP "\(haR"
As in forward searches.
-.IP "^W"
+.IP "\(haS"
+As in forward searches.
+.IP "\(haW"
WRAP around the current file.
That is, if the search reaches the beginning of the current file
without finding a match, the search continues from the last line of the
@@ -268,13 +291,13 @@ Same as "/*".
Same as "?*".
.IP n
Repeat previous search, for N-th line containing the last pattern.
-If the previous search was modified by ^N, the search is made for the
+If the previous search was modified by \(haN, the search is made for the
N-th line NOT containing the pattern.
-If the previous search was modified by ^E, the search continues
+If the previous search was modified by \(haE, the search continues
in the next (or previous) file if not satisfied in the current file.
-If the previous search was modified by ^R, the search is done
+If the previous search was modified by \(haR, the search is done
without using regular expressions.
-There is no effect if the previous search was modified by ^F or ^K.
+There is no effect if the previous search was modified by \(haF or \(haK.
.IP N
Repeat previous search, but in the reverse direction.
.IP "ESC-n"
@@ -308,9 +331,9 @@ which match all of the patterns will be displayed.
.sp
Certain characters are special as in the / command:
.RS
-.IP "^N or !"
+.IP "\(haN or !"
Display only lines which do NOT match the pattern.
-.IP "^R"
+.IP "\(haR"
Don't interpret regular expression metacharacters;
that is, do a simple textual comparison.
.RE
@@ -333,10 +356,10 @@ the list of files and the first one is examined.
If the filename contains one or more spaces,
the entire filename should be enclosed in double quotes
(also see the \-" option).
-.IP "^X^V or E"
+.IP "\(haX\(haV or E"
Same as :e.
-Warning: some systems use ^V as a special literalization character.
-On such systems, you may not be able to use ^V.
+Warning: some systems use \(haV as a special literalization character.
+On such systems, you may not be able to use \(haV.
.IP ":n"
Examine the next file (from the list of files given in the command line).
If a number N is specified, the N-th next file is examined.
@@ -353,7 +376,7 @@ Go to the next tag, if there were more than one matches for the current tag.
See the \-t option for more details about tags.
.IP "T"
Go to the previous tag, if there were more than one matches for the current tag.
-.IP "= or ^G or :f"
+.IP "= or \(haG or :f"
Prints some information about the file being viewed,
including its name
and the line number and byte offset of the bottom line being displayed.
@@ -364,7 +387,7 @@ and the percent of the file above the last displayed line.
Followed by one of the command line option letters (see OPTIONS below),
this will change the setting of that option
and print a message describing the new setting.
-If a ^P (CONTROL-P) is entered immediately after the dash,
+If a \(haP (CONTROL-P) is entered immediately after the dash,
the setting of the option is changed but no message is printed.
If the option letter has a numeric value (such as \-b or \-h),
or a string value (such as \-P or \-t),
@@ -375,7 +398,7 @@ the current setting is printed and nothing is changed.
Like the \- command, but takes a long option name (see OPTIONS below)
rather than a single option letter.
You must press ENTER or RETURN after typing the option name.
-A ^P immediately after the second dash suppresses printing of a
+A \(haP immediately after the second dash suppresses printing of a
message describing the new setting, as in the \- command.
.IP \-+
Followed by one of the command line option letters
@@ -408,19 +431,19 @@ You must press ENTER or RETURN after typing the option name.
.IP +cmd
Causes the specified cmd to be executed each time a new file is examined.
For example, +G causes
-.I less
+.B less
to initially display each file starting at the end
rather than the beginning.
.IP V
Prints the version number of
-.I less
+.B less
being run.
.IP "q or Q or :q or :Q or ZZ"
Exits
-.IR less .
+.BR less .
.PP
The following
-four
+six
commands may or may not be valid, depending on your particular installation.
.
.IP v
@@ -439,6 +462,10 @@ A pound sign (#) is replaced by the name of the previously examined file.
On Unix systems, the shell is taken from the environment variable SHELL,
or defaults to "sh".
On MS-DOS and OS/2 systems, the shell is the normal command processor.
+.IP "# shell-command"
+Similar to the "!" command,
+except that the command is expanded in the same way as prompt strings.
+For example, the name of the current file would be given as "%f".
.IP "| <m> shell-command"
<m> represents any mark letter.
Pipes a section of the input file to the given shell command.
@@ -446,19 +473,37 @@ The section of the file to be piped is between the position marked by
the letter and the current screen.
The entire current screen is included, regardless of whether the
marked position is before or after the current screen.
-<m> may also be ^ or $ to indicate beginning or end of file respectively.
+<m> may also be \(ha or $ to indicate beginning or end of file respectively.
If <m> is \&.\& or newline, the current screen is piped.
.IP "s filename"
Save the input to a file.
-This only works if the input is a pipe, not an ordinary file.
+This works only if the input is a pipe, not an ordinary file.
+.IP "\(haX"
+When the "Waiting for data" message is displayed,
+such as while in the F command, pressing \(haX
+will stop
+.B less
+from waiting and return to a prompt.
+This may cause
+.B less
+to think that the file ends at the current position,
+so it may be necessary to use the R or F command to see more data.
+The \-\-intr option can be used to specify a different character
+to use instead of \(haX.
+This command works only on systems that support the
+.BR poll (2)
+function.
+On systems without
+.BR poll (2),
+the interrupt character (usually \(haC) can be used instead.
.
.SH OPTIONS
Command line options are described below.
Most options may be changed while
-.I less
+.B less
is running, via the "\-" command.
.PP
-Most options may be given in one of two forms:
+Some options may be given in one of two forms:
either a dash followed by a single letter,
or two dashes followed by a long option name.
A long option name may be abbreviated as long as
@@ -474,14 +519,14 @@ For example, \-\-Quit-at-eof is equivalent to \-\-QUIT-AT-EOF.
Options are also taken from the environment variable "LESS".
For example,
to avoid typing "less \-options \&...\&" each time
-.I less
+.B less
is invoked, you might tell
-.IR csh :
+.BR csh :
.sp
setenv LESS "\-options"
.sp
or if you use
-.IR sh :
+.BR sh :
.sp
LESS="\-options"; export LESS
.sp
@@ -496,7 +541,7 @@ line option with "\-+".
.sp
Some options like \-k or \-D require a string to follow the option letter.
The string for that option is considered to end when a dollar sign ($) is found.
-For example, you can set two \-D options on MS-DOS like this:
+For example, you can set two \-D options like this:
.sp
LESS="Dn9.1$Ds4.1"
.sp
@@ -508,7 +553,7 @@ not treated specially, and there is no way to include a dollar sign
in the option string.
.IP "\-? or \-\-help"
This option displays a summary of the commands accepted by
-.I less
+.B less
(the same as the h command).
(Depending on how your shell interprets the question mark,
it may be necessary to quote the question mark, thus: "\-\e?".)
@@ -533,7 +578,7 @@ from the last line up to and including the target line.
This was the default behavior in less versions prior to 441.
.IP "\-b\fIn\fP or \-\-buffers=\fIn\fP"
Specifies the amount of buffer space
-.I less
+.B less
will use for each file, in units of kilobytes (1024 bytes).
By default 64\ KB of buffer space is used for each file
(unless the file is a pipe; see the \-B option).
@@ -553,20 +598,21 @@ is used for the pipe.
Warning: use of \-B can result in erroneous display, since only the
most recently viewed part of the piped data is kept in memory;
any earlier data is lost.
+Lost characters are displayed as question marks.
.IP "\-c or \-\-clear-screen"
Causes full screen repaints to be painted from the top line down.
By default,
full screen repaints are done by scrolling from the bottom of the screen.
.IP "\-C or \-\-CLEAR-SCREEN"
Same as \-c, for compatibility with older versions of
-.IR less .
+.BR less .
.IP "\-d or \-\-dumb"
The \-d option suppresses the error message
normally displayed if the terminal is dumb;
that is, lacks some important capability,
such as the ability to clear the screen or scroll backward.
The \-d option does not otherwise change the behavior of
-.I less
+.B less
on a dumb terminal.
.IP "\-D\fBx\fP\fIcolor\fP or \-\-color=\fBx\fP\fIcolor\fP"
Changes the color of different parts of the displayed text.
@@ -579,6 +625,8 @@ Binary characters.
Control characters.
.IP "E"
Errors and informational messages.
+.IP "H"
+Header lines and columns, set via the \-\-header option.
.IP "M"
Mark letters in the status column.
.IP "N"
@@ -589,6 +637,13 @@ Prompts.
The rscroll character.
.IP "S"
Search results.
+.IP "1-5"
+The text in a search result which matches
+the first through fifth parenthesized sub-pattern.
+Sub-pattern coloring works only if
+.B less
+is built with one of the regular expression libraries
+.BR posix ", " pcre ", or " pcre2 .
.IP "W"
The highlight enabled via the \-w option.
.IP "d"
@@ -602,18 +657,18 @@ Underlined text.
.RE
.RS
-The uppercase letters can be used only when the \-\-use-color option is enabled.
+The uppercase letters and digits can be used only when the \-\-use-color option is enabled.
When text color is specified by both an uppercase letter and a lowercase letter,
the uppercase letter takes precedence.
For example, error messages are normally displayed as standout text.
So if both "s" and "E" are given a color, the "E" color applies
to error messages, and the "s" color applies to other standout text.
The "d" and "u" letters refer to bold and underline text formed by
-overstriking with backspaces (see the \-u option),
+overstriking with backspaces (see the \-U option),
not to text using ANSI escape sequences with the \-R option.
.PP
A lowercase letter may be followed by a + to indicate that
-both the normal format change and the specified color should both be used.
+the normal format change and the specified color should both be used.
For example, \-Dug displays underlined text as green without underlining;
the green color has replaced the usual underline formatting.
But \-Du+g displays underlined text as both green and in underlined format.
@@ -640,7 +695,7 @@ White
.IP "y"
Yellow
.PP
-The corresponding upper-case letter denotes a brighter shade of the color.
+The corresponding uppercase letter denotes a brighter shade of the color.
For example, \-DNGk displays line numbers as bright green text on a black
background, and \-DEbR displays error messages as blue text on a
bright red background.
@@ -654,12 +709,12 @@ Each integer is a value between 0 and 255 inclusive which selects
a "CSI 38;5" color value (see
.br
.nh
-https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters)
+https://en.wikipedia.org/wiki/ANSI_escape_code#SGR)
.hy
If either integer is a "-" or is omitted,
the corresponding color is set to that of normal text.
On MS-DOS versions of
-.IR less ,
+.BR less ,
8-bit color is not supported; instead, decimal values are interpreted as 4-bit
CHAR_INFO.Attributes values
(see
@@ -667,41 +722,46 @@ CHAR_INFO.Attributes values
.nh
https://docs.microsoft.com/en-us/windows/console/char-info-str).
.hy
+.PP
+On MS-DOS only, the \-Da option may be used to specify strict parsing of
+ANSI color (SGR) sequences when the \-R option is used.
+Without this option, sequences that change text attributes
+(bold, underline, etc.) may clear the text color.
.RE
.IP "\-e or \-\-quit-at-eof"
Causes
-.I less
+.B less
to automatically exit
the second time it reaches end-of-file.
By default, the only way to exit
-.I less
+.B less
is via the "q" command.
.IP "\-E or \-\-QUIT-AT-EOF"
Causes
-.I less
+.B less
to automatically exit the first time it reaches end-of-file.
.IP "\-f or \-\-force"
Forces non-regular files to be opened.
(A non-regular file is a directory or a device special file.)
Also suppresses the warning message when a binary file is opened.
By default,
-.I less
+.B less
will refuse to open non-regular files.
Note that some operating systems will not allow directories
to be read, even if \-f is set.
.IP "\-F or \-\-quit-if-one-screen"
Causes
-.I less
+.B less
to automatically exit
if the entire file can be displayed on the first screen.
.IP "\-g or \-\-hilite-search"
Normally,
-.I less
+.B less
will highlight ALL strings which match the last search command.
The \-g option changes this behavior to highlight only the particular string
which was found by the last search command.
This can cause
-.I less
+.B less
to run somewhat faster than the default.
.IP "\-G or \-\-HILITE-SEARCH"
The \-G option suppresses all highlighting of strings found by search commands.
@@ -736,8 +796,7 @@ Alternately, the screen line may be specified as a fraction of the height
of the screen, starting with a decimal point: \&.5 is in the middle of the
screen, \&.3 is three tenths down from the first line, and so on.
If the line is specified as a fraction, the actual line number
-is recalculated if the terminal window is resized, so that the
-target line remains at the specified fraction of the screen height.
+is recalculated if the terminal window is resized.
If any form of the \-j option is used,
repeated forward searches (invoked with "n" or "N")
begin at the line immediately after the target line,
@@ -750,25 +809,42 @@ However nonrepeated searches (invoked with "/" or "?")
always begin at the start or end of the current screen respectively.
.IP "\-J or \-\-status-column"
Displays a status column at the left edge of the screen.
-The status column shows the lines that matched the current search,
-and any lines that are marked (via the m or M command).
+The character displayed in the status column may be one of:
+.RS
+.IP ">"
+The line is chopped with the \-S option, and
+the text that is chopped off beyond the right edge of the screen
+contains a match for the current search.
+.IP "<"
+The line is horizontally shifted, and
+the text that is shifted beyond the left side of the screen
+contains a match for the current search.
+.IP "="
+The line is both chopped and shifted,
+and there are matches beyond both sides of the screen.
+.IP "*"
+There are matches in the visible part of the line
+but none to the right or left of it.
+.IP "a-z, A-Z"
+The line has been marked with the corresponding letter via the m command.
+.RE
.IP "\-k\fIfilename\fP or \-\-lesskey-file=\fIfilename\fP"
Causes
-.I less
+.B less
to open and interpret the named file as a
-.IR lesskey (1)
+.BR lesskey (1)
binary file.
Multiple \-k options may be specified.
If the LESSKEY or LESSKEY_SYSTEM environment variable is set, or
if a lesskey file is found in a standard place (see KEY BINDINGS),
it is also used as a
-.I lesskey
+.B lesskey
file.
.IP "\-\-lesskey-src=\fIfilename\fP"
Causes
-.I less
+.B less
to open and interpret the named file as a
-.IR lesskey (1)
+.BR lesskey (1)
source file.
If the LESSKEYIN or LESSKEYIN_SYSTEM environment variable is set, or
if a lesskey source file is found in a standard place (see KEY BINDINGS),
@@ -776,26 +852,26 @@ it is also used as a
.I "lesskey source"
file.
Prior to version 582, the
-.I lesskey
+.B lesskey
program needed to be run to convert a
.I "lesskey source"
file to a
.I "lesskey binary"
file for
-.I less
+.B less
to use.
Newer versions of
-.I less
+.B less
read the
.I "lesskey source"
file directly and ignore the binary file if the source file exists.
.IP "\-K or \-\-quit-on-intr"
Causes
-.I less
+.B less
to exit immediately (with status 2)
-when an interrupt character (usually ^C) is typed.
+when an interrupt character (usually \(haC) is typed.
Normally, an interrupt character causes
-.I less
+.B less
to stop whatever it is doing and return to its command prompt.
Note that use of this option makes it impossible to return to the
command prompt from the "F" command.
@@ -803,26 +879,27 @@ command prompt from the "F" command.
Ignore the LESSOPEN environment variable
(see the INPUT PREPROCESSOR section below).
This option can be set from within
-.IR less ,
+.BR less ,
but it will apply only to files opened subsequently, not to the
file which is currently open.
.IP "\-m or \-\-long-prompt"
Causes
-.I less
-to prompt verbosely (like \fImore\fP),
+.B less
+to prompt verbosely (like
+.BR more (1)),
with the percent into the file.
By default,
-.I less
+.B less
prompts with a colon.
.IP "\-M or \-\-LONG-PROMPT"
Causes
-.I less
+.B less
to prompt even more verbosely than
-.IR more .
+.BR more (1).
.IP "\-n or \-\-line-numbers"
Suppresses line numbers.
The default (to use line numbers) may cause
-.I less
+.B less
to run more slowly in some cases, especially with a very large input file.
Suppressing line numbers with the \-n option will avoid this problem.
Using line numbers means: the line number will be displayed in the verbose
@@ -834,12 +911,12 @@ Causes a line number to be displayed at the beginning of
each line in the display.
.IP "\-o\fIfilename\fP or \-\-log-file=\fIfilename\fP"
Causes
-.I less
+.B less
to copy its input to the named file as it is being viewed.
This applies only when the input file is a pipe,
not an ordinary file.
If the file already exists,
-.I less
+.B less
will ask for confirmation before overwriting it.
.IP "\-O\fIfilename\fP or \-\-LOG-FILE=\fIfilename\fP"
The \-O option is like \-o, but it will overwrite an existing
@@ -847,23 +924,23 @@ file without asking for confirmation.
.sp
If no log file has been specified,
the \-o and \-O options can be used from within
-.I less
+.B less
to specify a log file.
Without a file name, they will simply report the name of the log file.
The "s" command is equivalent to specifying \-o from within
-.IR less .
+.BR less .
.IP "\-p\fIpattern\fP or \-\-pattern=\fIpattern\fP"
The \-p option on the command line is equivalent to
specifying +/\fIpattern\fP;
that is, it tells
-.I less
+.B less
to start at the first occurrence of \fIpattern\fP in the file.
.IP "\-P\fIprompt\fP or \-\-prompt=\fIprompt\fP"
Provides a way to tailor the three prompt
styles to your own preference.
This option would normally be put in the LESS environment
variable, rather than being typed in with each
-.I less
+.B less
command.
Such an option must either be the last option in the LESS variable,
or be terminated by a dollar sign.
@@ -873,7 +950,7 @@ to that string.
\-PM changes the long (\-M) prompt.
\-Ph changes the prompt for the help screen.
\-P= changes the message printed by the = command.
- \-Pw changes the message printed while waiting for data (in the F command).
+ \-Pw changes the message printed while waiting for data (in the "F" command).
.sp 1
All prompt strings consist of a sequence of
letters and special escape sequences.
@@ -895,9 +972,10 @@ where the terminal bell would have been rung.
.IP "\-r or \-\-raw-control-chars"
Causes "raw" control characters to be displayed.
The default is to display control characters using the caret notation;
-for example, a control-A (octal 001) is displayed as "^A".
+for example, a control-A (octal 001) is displayed as "\(haA"
+(with some exceptions as described under the \-U option).
Warning: when the \-r option is used,
-.I less
+.B less
cannot keep track of the actual appearance of the screen
(since this depends on how the screen responds to
each type of control character).
@@ -931,19 +1009,19 @@ ANSI color escape sequences are sequences of the form:
.sp
where the "...\&" is zero or more color specification characters.
You can make
-.I less
+.B less
think that characters other than "m" can end ANSI color escape sequences
by setting the environment variable LESSANSIENDCHARS to the list of
characters which can end a color escape sequence.
And you can make
-.I less
+.B less
think that characters other than the standard ones may appear between
the ESC and the m by setting the environment variable LESSANSIMIDCHARS
to the list of characters which can appear.
.IP "\-s or \-\-squeeze-blank-lines"
Causes consecutive blank lines to be squeezed into a single blank line.
This is useful when viewing
-.I nroff
+.B nroff
output.
.IP "\-S or \-\-chop-long-lines"
Causes lines longer than the screen width to be
@@ -952,27 +1030,28 @@ That is, the portion of a long line that does not fit in
the screen width is not displayed until you press RIGHT-ARROW.
The default is to wrap long lines; that is, display the remainder
on the next line.
+See also the \-\-wordwrap option.
.IP "\-t\fItag\fP or \-\-tag=\fItag\fP"
The \-t option, followed immediately by a TAG,
will edit the file containing that tag.
For this to work, tag information must be available;
for example, there may be a file in the current directory called "tags",
which was previously built by
-.IR ctags (1)
+.BR ctags (1)
or an equivalent command.
If the environment variable LESSGLOBALTAGS is set, it is taken to be
the name of a command compatible with
-.IR global (1),
+.BR global (1),
and that command is executed to find the tag.
(See
.nh
http://www.gnu.org/software/global/global.html).
.hy
The \-t option may also be specified from within
-.I less
+.B less
(using the \- command) as a way of examining a new file.
The command ":t" is equivalent to specifying \-t from within
-.IR less .
+.BR less .
.IP "\-T\fItagsfile\fP or \-\-tag-file=\fItagsfile\fP"
Specifies a tags file to be used instead of "tags".
.IP "\-u or \-\-underline-special"
@@ -999,9 +1078,12 @@ Unicode formatting characters, such as the Byte Order Mark,
are sent to the terminal.
Text which is overstruck or underlined can be searched for
if neither \-u nor \-U is in effect.
+.sp
+See also the \-\-proc-backspace, \-\-proc-tab,
+and \-\-proc-return options.
.IP "\-V or \-\-version"
Displays the version number of
-.IR less .
+.BR less .
.IP "\-w or \-\-hilite-unread"
Temporarily highlights the first "new" line after a forward movement
of a full page.
@@ -1009,7 +1091,10 @@ The first "new" line is the line immediately following the line previously
at the bottom of the screen.
Also highlights the target line after a g or p command.
The highlight is removed at the next command which causes movement.
-The entire line is highlighted, unless the \-J option is in effect,
+If the \-\-status-line option is in effect, the entire line
+(the width of the screen) is highlighted.
+Otherwise, only the text in the line is highlighted,
+unless the \-J option is in effect,
in which case only the status column is highlighted.
.IP "\-W or \-\-HILITE-UNREAD"
Like \-w, but temporarily highlights the first new line after any
@@ -1020,7 +1105,7 @@ If only one \fIn\fP is specified, tab stops are set at multiples of \fIn\fP.
If multiple values separated by commas are specified, tab stops
are set at those positions, and then continue with the same spacing as the
last two.
-For example, \fI\-x9,17\fP will set tabs at positions 9, 17, 25, 33, etc.
+For example, "-x9,17" will set tabs at positions 9, 17, 25, 33, etc.
The default for \fIn\fP is 8.
.IP "\-X or \-\-no-init"
Disables sending the termcap initialization and deinitialization strings
@@ -1039,7 +1124,7 @@ Changes the default scrolling window size to \fIn\fP lines.
The default is one screenful.
The z and w commands can also be used to change the window size.
The "z" may be omitted for compatibility with some versions of
-.IR more .
+.BR more (1).
If the number
.I n
is negative, it indicates
@@ -1062,8 +1147,8 @@ Filenames containing a space should then be preceded by the open quote
character and followed by the close quote character.
Note that even after the quote characters are changed, this option
remains \-" (a dash followed by a double quote).
-.IP "\-~ or \-\-tilde"
-Normally lines after end of file are displayed as a single tilde (~).
+.IP "\-\(ti or \-\-tilde"
+Normally lines after end of file are displayed as a single tilde (\(ti).
This option causes lines after end of file to be displayed as blank lines.
.IP "\-# or \-\-shift"
Specifies the default number of positions to scroll horizontally
@@ -1074,36 +1159,95 @@ Alternately, the number may be specified as a fraction of the width
of the screen, starting with a decimal point: \&.5 is half of the
screen width, \&.3 is three tenths of the screen width, and so on.
If the number is specified as a fraction, the actual number of
-scroll positions is recalculated if the terminal window is resized,
-so that the actual scroll remains at the specified fraction
-of the screen width.
+scroll positions is recalculated if the terminal window is resized.
+.IP "\-\-exit-follow-on-close"
+When using the "F" command on a pipe,
+.B less
+will automatically stop waiting for more data when the input side of the
+pipe is closed.
.IP "\-\-file-size"
If \-\-file-size is specified,
-.I less
+.B less
will determine the size of the file
immediately after opening the file.
-Normally this is not done, because it can be slow if the input file is large.
+Then the "=" command will display the number of lines in the file.
+Normally this is not done, because it can be slow if the input file
+is non-seekable (such as a pipe) and is large.
.IP "\-\-follow-name"
Normally, if the input file is renamed while an F command is executing,
-.I less
+.B less
will continue to display the contents of the original file despite
its name change.
If \-\-follow-name is specified, during an F command
-.I less
+.B less
will periodically attempt to reopen the file by name.
If the reopen succeeds and the file is a different file from the original
(which means that a new file has been created
with the same name as the original (now renamed) file),
-.I less
+.B less
will display the contents of that new file.
+.IP "\-\-header=\fIN[,M]\fP"
+Sets the number of header lines and columns displayed on the screen.
+The value may be of the form "N,M" where N and M are integers,
+to set the header lines to N and the header columns to M,
+or it may be a single integer "N" which sets the header lines to N
+and the header columns to zero,
+or it may be ",M" which sets the header columns to M and the
+header lines to zero.
+When N is nonzero, the first N lines at the top
+of the screen are replaced with the first N lines of the file,
+regardless of what part of the file are being viewed.
+When M is nonzero, the characters displayed at the
+beginning of each line are replaced with the first M characters of the line,
+even if the rest of the line is scrolled horizontally.
+If either N or M is zero,
+.B less
+stops displaying header lines or columns, respectively.
+(Note that it may be necessary to change the setting of the \-j option
+to ensure that the target line is not obscured by the header line(s).)
.IP "\-\-incsearch"
Subsequent search commands will be "incremental"; that is,
-.I less
+.B less
will advance to the next line containing the search pattern
as each character of the pattern is typed in.
-.IP "\-\-line-num-width"
-Sets the minimum width of the line number field when the \-N option is in effect.
-The default is 7 characters.
+.IP "\-\-intr=\fIc\fP"
+Use the character \fIc\fP instead of \(haX to interrupt a read
+when the "Waiting for data" message is displayed.
+\fIc\fP must be an ASCII character; that is, one with a value
+between 1 and 127 inclusive.
+A caret followed by a single character can be used
+to specify a control character.
+.IP "\-\-line-num-width=\fIn\fP"
+Sets the minimum width of the line number field when the \-N option is in effect
+to \fIn\fP characters.
+The default is 7.
+.IP "\-\-modelines=\fIn\fP"
+.RS
+Before displaying a file,
+.B less
+will read the first \fIn\fP lines to try to find a vim-compatible
+.IR modeline .
+If \fIn\fP is zero,
+.B less
+does not try to find modelines.
+By using a modeline, the file itself can specify the tab stops
+that should be used when viewing it.
+.PP
+A modeline contains, anywhere in the line,
+a program name ("vi", "vim", "ex", or "less"),
+followed by a colon,
+possibly followed by the word "set",
+and finally followed by zero or more option settings.
+If the word "set" is used,
+option settings are separated by spaces, and end at the first colon.
+If the word "set" is not used,
+option settings may be separated by either spaces or colons.
+The word "set" is required if the program name is "less"
+but optional if any of the other three names are used.
+If any option setting is of the form "tabstop=\fIn\fP" or "ts=\fIn\fP",
+then tab stops are automatically set as if \-\-tabs=\fIn\fP had been given.
+See the \-\-tabs description for acceptable values of \fIn\fP.
+.RE
.IP "\-\-mouse"
Enables mouse input:
scrolling the mouse wheel down moves forward in the file,
@@ -1114,7 +1258,7 @@ The number of lines to scroll when the wheel is moved
can be set by the \-\-wheel-lines option.
Mouse input works only on terminals which support X11 mouse reporting,
and on the Windows version of
-.IR less .
+.BR less .
.IP "\-\-MOUSE"
Like \-\-mouse, except the direction scrolled
on mouse wheel movement is reversed.
@@ -1129,7 +1273,53 @@ file name is typed in, and the same string is already in the history list,
the existing copy is removed from the history list before the new one is added.
Thus, a given string will appear only once in the history list.
Normally, a string may appear multiple times.
-.IP "\-\-rscroll"
+.IP "\-\-no-number-headers"
+Header lines (defined via the \-\-header option) are not assigned line numbers.
+Line number 1 is assigned to the first line after any header lines.
+.IP "\-\-no-search-headers"
+Searches do not include header lines or header columns.
+.IP "\-\-no-vbell"
+Disables the terminal's visual bell.
+.IP "\-\-proc-backspace"
+If set, backspaces are handled as if neither the \-u option
+nor the \-U option were set.
+That is, a backspace adjacent to an underscore causes text to be
+displayed in underline mode, and a backspace between identical
+characters cause text to be displayed in boldface mode.
+This option overrides the \-u and \-U options, so that display of
+backspaces can be controlled separate from tabs and carriage returns.
+If not set, backspace display is controlled by the \-u and \-U options.
+.IP "\-\-PROC-BACKSPACE"
+If set, backspaces are handled as if the \-U option were set;
+that is backspaces are treated as control characters.
+.IP "\-\-proc-return"
+If set, carriage returns are handled as if neither the \-u option
+nor the \-U option were set.
+That is, a carriage return immediately before a newline is deleted.
+This option overrides the \-u and \-U options, so that display of
+carriage returns can be controlled separate from that of backspaces and tabs.
+If not set, carriage return display is controlled by the \-u and \-U options.
+.IP "\-\-PROC-RETURN"
+If set, carriage returns are handled as if the \-U option were set;
+that is carriage returns are treated as control characters.
+.IP "\-\-proc-tab"
+If set, tabs are handled as if the \-U option were not set.
+That is, tabs are expanded to spaces.
+This option overrides the \-U option, so that display of
+tabs can be controlled separate from that of backspaces and carriage returns.
+If not set, tab display is controlled by the \-U options.
+.IP "\-\-PROC-TAB"
+If set, tabs are handled as if the \-U option were set;
+that is tabs are treated as control characters.
+.IP "\-\-redraw-on-quit"
+When quitting, after sending the terminal deinitialization string,
+redraws the entire last screen.
+On terminals whose terminal deinitialization string causes the
+terminal to switch from an alternate screen,
+this makes the last screenful of the current file remain visible after
+.B less
+has quit.
+.IP "\-\-rscroll=\fIc\fP"
This option changes the character used to mark truncated lines.
It may begin with a two-character attribute indicator like LESSBINFMT does.
If there is no attribute indicator, standout is used.
@@ -1137,18 +1327,41 @@ If set to "\-", truncated lines are not marked.
.IP "\-\-save-marks"
Save marks in the history file, so marks are retained
across different invocations of
-.IR less .
-.IP "\-\-status-col-width"
+.BR less .
+.IP "\-\-search-options=\fI...\fP"
+Sets default search modifiers.
+The value is a string of one or more of the characters
+E, F, K, N, R or W.
+Setting any of these has the same effect as typing that
+control character at the beginning of every search pattern.
+For example, setting \-\-search-options=W is the same as
+typing \(haW at the beginning of every pattern.
+The value may also contain a digit between 1 and 5,
+which has the same effect as typing \(haS followed by that digit
+at the beginning of every search pattern.
+The value "-" disables all default search modifiers.
+.IP "\-\-show-preproc-errors"
+If a preprocessor produces data,
+then exits with a non-zero exit code,
+.B less
+will display a warning.
+.IP "\-\-status-col-width=\fIn\fP"
Sets the width of the status column when the \-J option is in effect.
The default is 2 characters.
+.IP "\-\-status-line"
+If a line is marked, the entire line (rather than just the status column)
+is highlighted.
+Also lines highlighted due to the \-w option will have
+the entire line highlighted.
+If \-\-use-color is set, the line is colored rather than highlighted.
.IP "\-\-use-backslash"
This option changes the interpretations of options which follow this one.
After the \-\-use-backslash option, any backslash in an option string is
removed and the following character is taken literally.
This allows a dollar sign to be included in option strings.
.IP "\-\-use-color"
-Enables the colored text in various places.
-The -D option can be used to change the colors.
+Enables colored text in various places.
+The \-D option can be used to change the colors.
Colored text works only if the terminal supports
ANSI color escape sequences (as defined in ECMA-48 SGR;
see
@@ -1160,6 +1373,11 @@ https://www.ecma-international.org/publications-and-standards/standards/ecma-48)
Set the number of lines to scroll when the mouse wheel is scrolled
and the \-\-mouse or \-\-MOUSE option is in effect.
The default is 1 line.
+.IP "\-\-wordwrap"
+When the \-S option is not in use,
+wrap each line at a space or tab if possible,
+so that a word is not split between two lines.
+The default is to wrap at any character.
.IP \-\-
A command line argument of "\-\-" marks the end of option arguments.
Any arguments following this are interpreted as filenames.
@@ -1167,9 +1385,9 @@ This can be useful when viewing a file whose name begins with a "\-" or "+".
.IP +
If a command line option begins with \fB+\fP,
the remainder of that option is taken to be an initial command to
-.IR less .
+.BR less .
For example, +G tells
-.I less
+.B less
to start at the end of the file rather than the beginning,
and +/xyz tells it to start at the first occurrence of "xyz" in the file.
As a special case, +<number> acts like +<number>g;
@@ -1190,16 +1408,16 @@ a key does not exist on a particular keyboard.
(Note that the forms beginning with ESC do not work
in some MS-DOS and Windows systems because ESC is the line erase character.)
Any of these special keys may be entered literally by preceding
-it with the "literal" character, either ^V or ^A.
+it with the "literal" character, either \(haV or \(haA.
A backslash itself may also be entered literally by entering two backslashes.
.IP "LEFTARROW [ ESC-h ]"
Move the cursor one space to the left.
.IP "RIGHTARROW [ ESC-l ]"
Move the cursor one space to the right.
-.IP "^LEFTARROW [ ESC-b or ESC-LEFTARROW ]"
+.IP "\(haLEFTARROW [ ESC-b or ESC-LEFTARROW ]"
(That is, CONTROL and LEFTARROW simultaneously.)
Move the cursor one word to the left.
-.IP "^RIGHTARROW [ ESC-w or ESC-RIGHTARROW ]"
+.IP "\(haRIGHTARROW [ ESC-w or ESC-RIGHTARROW ]"
(That is, CONTROL and RIGHTARROW simultaneously.)
Move the cursor one word to the right.
.IP "HOME [ ESC-0 ]"
@@ -1211,10 +1429,10 @@ Delete the character to the left of the cursor,
or cancel the command if the command line is empty.
.IP "DELETE or [ ESC-x ]"
Delete the character under the cursor.
-.IP "^BACKSPACE [ ESC-BACKSPACE ]"
+.IP "\(haBACKSPACE [ ESC-BACKSPACE ]"
(That is, CONTROL and BACKSPACE simultaneously.)
Delete the word to the left of the cursor.
-.IP "^DELETE [ ESC-X or ESC-DELETE ]"
+.IP "\(haDELETE [ ESC-X or ESC-DELETE ]"
(That is, CONTROL and DELETE simultaneously.)
Delete the word under the cursor.
.IP "UPARROW [ ESC-k ]"
@@ -1236,82 +1454,84 @@ The environment variable LESSSEPARATOR can be used to specify a
different character to append to a directory name.
.IP "BACKTAB [ ESC-TAB ]"
Like, TAB, but cycles in the reverse direction thru the matching filenames.
-.IP "^L"
+.IP "\(haL"
Complete the partial filename to the left of the cursor.
If it matches more than one filename, all matches are entered into
the command line (if they fit).
-.IP "^U (Unix and OS/2) or ESC (MS-DOS)"
+.IP "\(haU (Unix and OS/2) or ESC (MS-DOS)"
Delete the entire command line,
or cancel the command if the command line is empty.
If you have changed your line-kill character in Unix to something
-other than ^U, that character is used instead of ^U.
-.IP "^G"
+other than \(haU, that character is used instead of \(haU.
+.IP "\(haG"
Delete the entire command line and return to the main prompt.
.
.SH "KEY BINDINGS"
You may define your own
-.I less
+.B less
commands by creating a lesskey source file.
This file specifies a set of command keys and an action
associated with each key.
You may also change the line-editing keys (see LINE EDITING),
-and to set environment variables.
+and set environment variables used by
+.BR less .
+See the
+.BR lesskey (1)
+manual page for details about the file format.
+.PP
If the environment variable LESSKEYIN is set,
-.I less
+.B less
uses that as the name of the lesskey source file.
Otherwise,
-.I less
+.B less
looks in a standard place for the lesskey source file:
On Unix systems,
-.I less
-looks for a lesskey file called "$XDG_CONFIG_HOME/lesskey" or "$HOME/.lesskey".
+.B less
+looks for a lesskey file called "$XDG_CONFIG_HOME/lesskey" or "$HOME/.config/lesskey" or "$HOME/.lesskey".
On MS-DOS and Windows systems,
-.I less
+.B less
looks for a lesskey file called "$HOME/_lesskey", and if it is not found there,
then looks for a lesskey file called "_lesskey" in any directory specified
in the PATH environment variable.
On OS/2 systems,
-.I less
+.B less
looks for a lesskey file called "$HOME/lesskey.ini", and if it is not found,
then looks for a lesskey file called "lesskey.ini" in any directory specified
in the INIT environment variable, and if it not found there,
then looks for a lesskey file called "lesskey.ini" in any directory specified
in the PATH environment variable.
-See the
-.I lesskey
-manual page for more details.
.PP
A system-wide lesskey source file may also be set up to provide key bindings.
If a key is defined in both a local lesskey file and in the
system-wide file, key bindings in the local file take precedence over
those in the system-wide file.
If the environment variable LESSKEYIN_SYSTEM is set,
-.I less
+.B less
uses that as the name of the system-wide lesskey file.
Otherwise,
-.I less
+.B less
looks in a standard place for the system-wide lesskey file:
On Unix systems, the system-wide lesskey file is /usr/local/etc/syslesskey.
(However, if
-.I less
+.B less
was built with a different sysconf directory than /usr/local/etc,
that directory is where the sysless file is found.)
On MS-DOS and Windows systems, the system-wide lesskey file is c:\e_syslesskey.
On OS/2 systems, the system-wide lesskey file is c:\esyslesskey.ini.
.PP
Previous versions of
-.I less
+.B less
(before v582) used lesskey files with a binary format, produced by the
-.I lesskey
+.B lesskey
program. It is no longer necessary to use the
-.I lesskey
+.B lesskey
program.
.
.SH "INPUT PREPROCESSOR"
You may define an "input preprocessor" for
-.IR less .
+.BR less .
Before
-.I less
+.B less
opens a file, it first gives your input preprocessor a chance to modify the
way the contents of the file are displayed.
An input preprocessor is simply an executable program (or shell script),
@@ -1321,7 +1541,7 @@ The contents of the replacement file are then displayed
in place of the contents of the original file.
However, it will appear to the user as if the original file is opened;
that is,
-.I less
+.B less
will display the original filename as the name of the current file.
.PP
An input preprocessor receives one command line argument, the original filename,
@@ -1329,7 +1549,7 @@ as entered by the user.
It should create the replacement file, and when finished,
print the name of the replacement file to its standard output.
If the input preprocessor does not output a replacement filename,
-.I less
+.B less
uses the original file, as normal.
The input preprocessor is not called when viewing standard input.
To set up an input preprocessor, set the LESSOPEN environment variable
@@ -1339,7 +1559,7 @@ which will be replaced by the filename
when the input preprocessor command is invoked.
.PP
When
-.I less
+.B less
closes a file opened in such a way, it will call another program,
called the input postprocessor,
which may perform any desired clean-up action (such as deleting the
@@ -1355,7 +1575,7 @@ which was output by LESSOPEN.
.PP
For example, on many Unix systems, these two scripts will allow you
to keep files in compressed format, but still let
-.I less
+.B less
view them directly:
.PP
lessopen.sh:
@@ -1396,7 +1616,7 @@ to accept other types of compressed files, and so on.
.PP
It is also possible to set up an input preprocessor to
pipe the file data directly to
-.IR less ,
+.BR less ,
rather than putting the data into a replacement file.
This avoids the need to decompress the entire file before
starting to view it.
@@ -1406,7 +1626,7 @@ its standard output,
writes the entire contents of the replacement file on its standard output.
If the input pipe does not write any characters on its standard output,
then there is no replacement file and
-.I less
+.B less
uses the original file, as normal.
To use an input pipe,
make the first character in the LESSOPEN environment variable a
@@ -1443,13 +1663,13 @@ Note that a preprocessor cannot output an empty file, since that
is interpreted as meaning there is no replacement, and
the original file is used.
To avoid this, if LESSOPEN starts with two vertical bars,
-the exit status of the script becomes meaningful.
-If the exit status is zero, the output is considered to be
-replacement text, even if it is empty.
-If the exit status is nonzero, any output is ignored and the
-original file is used.
+the exit status of the script determines the behavior when the output is empty.
+If the output is empty and the exit status is zero,
+the empty output is considered to be replacement text.
+If the output is empty and the exit status is nonzero,
+the original file is used.
For compatibility with previous versions of
-.IR less ,
+.BR less ,
if LESSOPEN starts with only one vertical bar, the exit status
of the preprocessor is ignored.
.PP
@@ -1460,9 +1680,9 @@ In this case, the replacement file name passed to the LESSCLOSE
postprocessor is "\-".
.PP
For compatibility with previous versions of
-.IR less ,
+.BR less ,
the input preprocessor or pipe is not used if
-.I less
+.B less
is viewing standard input.
However, if the first character of LESSOPEN is a dash (\-),
the input preprocessor is used on standard input as well as other files.
@@ -1524,7 +1744,7 @@ It is the only character set that supports multi-byte characters.
Selects a character set appropriate for Microsoft Windows (cp 1251).
.PP
In rare cases, it may be desired to tailor
-.I less
+.B less
to use a character set other than the ones definable by LESSCHARSET.
In this case, the environment variable LESSCHARDEF can be used
to define a character set.
@@ -1565,9 +1785,9 @@ is found in the LC_ALL, LC_CTYPE or LANG
environment variables, then the default character set is utf-8.
.PP
If that string is not found, but your system supports the
-.I setlocale
+.B setlocale
interface,
-.I less
+.B less
will use setlocale to determine the character set.
setlocale is controlled by setting the LANG or LC_CTYPE environment
variables.
@@ -1578,7 +1798,7 @@ interface is also not available, the default character set is latin1.
.PP
Control and binary characters are displayed in standout (reverse video).
Each such character is displayed in caret notation if possible
-(e.g.\& ^A for control-A). Caret notation is used only if
+(e.g.\& \(haA for control-A). Caret notation is used only if
inverting the 0100 bit results in a normal printable character.
Otherwise, the character is displayed as a hex number in angle brackets.
This format can be changed by
@@ -1610,7 +1830,45 @@ octets of a complete but non-shortest form sequence, invalid octets,
and stray trailing octets)
are displayed individually using LESSBINFMT so as to facilitate diagnostic
of how the UTF-8 file is ill-formed.
-.
+.PP
+When the character set is utf-8, in rare cases it may be desirable to
+override the Unicode definition of the type of certain characters.
+For example, characters in a Private Use Area are normally treated as control
+characters, but if you are using a custom font with printable characters
+in that range, it may be desirable to tell
+.B less
+to treat such characters as printable.
+This can be done by setting the LESSUTFCHARDEF environment variable
+to a comma-separated list of
+.I "character type"
+definitions.
+Each character type definition consists of either one hexadecimal codepoint
+or a pair of codepoints separated by a dash,
+followed by a colon and a type character.
+Each hexadecimal codepoint may optionally be preceded by a "U" or "U+".
+If a pair of codepoints is given, the type is set for
+all characters inclusively between the two values.
+If there are multiple comma-separated codepoint values,
+they must be in ascending numerical order.
+The type character may be one of:
+.RS
+.IP "p"
+A normal printable character.
+.IP "w"
+A wide (2-space) printable character.
+.IP "b"
+A binary (non-printable) character.
+.IP "c"
+A composing (zero width) character.
+.RE
+.PP
+For example, setting LESSUTFCHARDEF to
+.nf
+.sp
+ E000-F8FF:p,F0000-FFFFD:p,100000-10FFFD:p
+.sp
+.fi
+would make all Private Use Area characters be treated as printable.
.SH "PROMPTS"
The \-P option allows you to tailor the prompt to your preference.
The string given to the \-P option replaces the specified prompt string.
@@ -1620,7 +1878,9 @@ but the ordinary user need not understand the details of constructing
personalized prompt strings.
.sp
A percent sign followed by a single character is expanded
-according to what the following character is:
+according to what the following character is.
+(References to the input file size below refer to the preprocessed size,
+if an input preprocessor is being used.)
.IP "%b\fIX\fP"
Replaced by the byte offset into the current input file.
The b is followed by a single character (shown as \fIX\fP above)
@@ -1801,12 +2061,14 @@ changed to modify this default.
.
.SH SECURITY
When the environment variable LESSSECURE is set to 1,
-.I less
+.B less
runs in a "secure" mode.
This means these features are disabled:
.RS
.IP "!"
the shell command
+.IP "#"
+the pshell command
.IP "|"
the pipe command
.IP ":e"
@@ -1822,7 +2084,9 @@ use of tags files
.IP
metacharacters in filenames, such as *
.IP
-filename completion (TAB, ^L)
+filename completion (TAB, \(haL)
+.IP
+history file
.RE
.PP
Less can also be compiled to be permanently in "secure" mode.
@@ -1830,16 +2094,18 @@ Less can also be compiled to be permanently in "secure" mode.
.SH "COMPATIBILITY WITH MORE"
If the environment variable LESS_IS_MORE is set to 1,
or if the program is invoked via a file link named "more",
-.I less
-behaves (mostly) in conformance with the POSIX "more" command specification.
+.B less
+behaves (mostly) in conformance with the POSIX
+.BR more (1)
+command specification.
In this mode, less behaves differently in these ways:
.PP
The \-e option works differently.
If the \-e option is not set,
-.I less
+.B less
behaves as if the \-e option were set.
If the \-e option is set,
-.I less
+.B less
behaves as if the \-E option were set.
.PP
The \-m option works differently.
@@ -1851,7 +2117,7 @@ The \-n option acts like the \-z option.
The normal behavior of the \-n option is unavailable in this mode.
.PP
The parameter to the \-p option is taken to be a
-.I less
+.B less
command rather than a search pattern.
.PP
The LESS environment variable is ignored,
@@ -1860,7 +2126,7 @@ and the MORE environment variable is used in its place.
.SH "ENVIRONMENT VARIABLES"
Environment variables may be specified either in the system environment
as usual, or in a
-.IR lesskey (1)
+.BR lesskey (1)
file.
If environment variables are defined in more than one place,
variables defined in a local lesskey file take precedence over
@@ -1889,7 +2155,7 @@ Language for determining the character set.
Language for determining the character set.
.IP LESS
Options which are passed to
-.I less
+.B less
automatically.
.IP LESSANSIENDCHARS
Characters which may end an ANSI color escape sequence
@@ -1897,7 +2163,7 @@ Characters which may end an ANSI color escape sequence
.IP LESSANSIMIDCHARS
Characters which may appear between the ESC character and the
end character in an ANSI color escape sequence
-(default "0123456789:;[?!"'#%()*+\ ".
+(default "0123456789:;[?!"\(aq#%()*+\ ".
.IP LESSBINFMT
Format for displaying non-printable, non-control characters.
.IP LESSCHARDEF
@@ -1916,17 +2182,23 @@ See discussion under PROMPTS.
.IP LESSGLOBALTAGS
Name of the command used by the \-t option to find global tags.
Normally should be set to "global" if your system has the
-.IR global (1)
+.BR global (1)
command. If not set, global tags are not used.
.IP LESSHISTFILE
Name of the history file used to remember search commands and
shell commands between invocations of
-.IR less .
+.BR less .
If set to "\-" or "/dev/null", a history file is not used.
-The default is "$XDG_DATA_HOME/lesshst" or "$HOME/.lesshst" on Unix systems,
-"$HOME/_lesshst" on DOS and Windows systems,
-or "$HOME/lesshst.ini" or "$INIT/lesshst.ini"
-on OS/2 systems.
+The default depends on the operating system, but is usually:
+.RS
+.IP "Linux and Unix"
+"$XDG_STATE_HOME/lesshst" or "$HOME/.local/state/lesshst" or
+"$XDG_DATA_HOME/lesshst" or "$HOME/.lesshst".
+.IP "Windows and MS-DOS"
+"$HOME/_lesshst".
+.IP "OS/2"
+"$HOME/lesshst.ini" or "$INIT/lesshst.ini".
+.RE
.IP LESSHISTSIZE
The maximum number of commands to save in the history file.
The default is 100.
@@ -1962,10 +2234,39 @@ See discussion under SECURITY.
String to be appended to a directory name in filename completion.
.IP LESSUTFBINFMT
Format for displaying non-printable Unicode code points.
+.IP LESSUTFCHARDEF
+Overrides the type of specified Unicode characters.
+.IP LESS_COLUMNS
+Sets the number of columns on the screen.
+Unlike COLUMNS, takes precedence over the system's idea of the screen size,
+so it can be used to make
+.B less
+use less than the full screen width.
+If set to a negative number, sets the number of columns used to
+this much less than the actual screen width.
+.IP LESS_LINES
+Sets the number of lines on the screen.
+Unlike LINES, takes precedence over the system's idea of the screen size,
+so it can be used to make
+.B less
+use less than the full screen height.
+If set to a negative number, sets the number of lines used to
+this much less than the actual screen height.
+When set,
+.B less
+repaints the entire screen on every movement command,
+so scrolling may be slower.
+.IP LESS_DATA_DELAY
+Duration (in milliseconds) after starting to read data from the input,
+after which the "Waiting for data" message will be displayed.
+The default is 4000 (4 seconds).
.IP LESS_IS_MORE
Emulate the
-.IR more (1)
+.BR more (1)
command.
+.IP LESS_TERMCAP_xx
+Where "xx" is any two characters, overrides the definition
+of the termcap "xx" capability for the terminal.
.IP LINES
Sets the number of lines on the screen.
Takes precedence over the number of lines specified by the TERM variable.
@@ -1974,10 +2275,9 @@ the window system's idea of the screen size takes precedence over the
LINES and COLUMNS environment variables.)
.IP MORE
Options which are passed to
-.I less
+.B less
automatically when running in
-.I more
-compatible mode.
+.BR more "-compatible mode."
.IP PATH
User's search path (used to find a lesskey file
on MS-DOS and OS/2 systems).
@@ -1985,16 +2285,25 @@ on MS-DOS and OS/2 systems).
The shell used to execute the !\& command, as well as to expand filenames.
.IP TERM
The type of terminal on which
-.I less
+.B less
is being run.
.IP VISUAL
The name of the editor (used for the v command).
+.IP XDG_CONFIG_HOME
+Possible location of the
+.B lesskey
+file; see the KEY BINDINGS section.
+.IP XDG_DATA_HOME
+Possible location of the history file; see the description of the LESSHISTFILE environment variable.
+.IP XDG_STATE_HOME
+Possible location of the history file; see the description of the LESSHISTFILE environment variable.
.
.SH "SEE ALSO"
-.BR lesskey (1)
+.BR lesskey (1),
+.BR lessecho (1)
.
.SH COPYRIGHT
-Copyright (C) 1984-2021 Mark Nudelman
+Copyright (C) 1984-2023 Mark Nudelman
.PP
less is part of the GNU project and is free software.
You can redistribute it and/or modify it