printf‐style escape sequence (a % followed by x, X, o, d, etc.). For example, if LESSBINFMT is "*u[%x]", binary characters are displayed in underlined
hexadecimal surrounded by brackets. The default if no LESSBINFMT is specified is "*s<%02X>". Warning: the result of expanding the character via LESSBINFMT must be less than 31 characters.
When the character set is utf‐8, the LESSUTFBINFMT environment variable acts similarly to LESSBINFMT but it applies to Unicode code points that were successfully decoded but are unsuitable for display (e.g., unas‐
signed code points). Its default value is "<U+%04lX>". Note that LESSUTFBINFMT and LESSBINFMT share their display attribute setting ("*x") so specifying one will affect both; LESSUTFBINFMT is read after LESSBINFMT
so its setting, if any, will have priority. Problematic octets in a UTF‐8 file (octets of a truncated sequence, octets of a complete but non‐shortest form sequence, invalid octets, and stray trailing octets) are dis‐
played individually using LESSBINFMT so as to facilitate diagnostic of how the UTF‐8 file is ill‐formed.
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. Certain characters in the string are interpreted specially. The prompt mech‐
anism is rather complicated to provide flexibility, but the ordinary user need not understand the details of constructing personalized prompt strings.
A percent sign followed by a single character is expanded according to what the following character is:
%bX Replaced by the byte offset into the current input file. The b is followed by a single character (shown as X above) which specifies the line whose byte offset is to be used. If the character is a "t", the
byte offset of the top line in the display is used, an "m" means use the middle line, a "b" means use the bottom line, a "B" means use the line just after the bottom line, and a "j" means use the "target" line,
as specified by the -j option.
%B Replaced by the size of the current input file.
%c Replaced by the column number of the text appearing in the first column of the screen.
%dX Replaced by the page number of a line in the input file. The line to be used is determined by the X, as with the %b option.
%D Replaced by the number of pages in the input file, or equivalently, the page number of the last line in the input file.
%E Replaced by the name of the editor (from the VISUAL environment variable, or the EDITOR environment variable if VISUAL is not defined). See the discussion of the LESSEDIT feature below.
%f Replaced by the name of the current input file.
%F Replaced by the last component of the name of the current input file.
%g Replaced by the shell‐escaped name of the current input file. This is useful when the expanded string will be used in a shell command, such as in LESSEDIT.
%i Replaced by the index of the current file in the list of input files.
%lX Replaced by the line number of a line in the input file. The line to be used is determined by the X, as with the %b option.
%L Replaced by the line number of the last line in the input file.
%m Replaced by the total number of input files.
%pX Replaced by the percent into the current input file, based on byte offsets. The line used is determined by the X as with the %b option.
%PX Replaced by the percent into the current input file, based on line numbers. The line used is determined by the X as with the %b option.
%s Same as %B.
%t Causes any trailing spaces to be removed. Usually used at the end of the string, but may appear anywhere.
%T Normally expands to the word "file". However if viewing files via