Home Explore Blog CI



man-pages

9th chunk of `less.man`
f92128a442cb8f1ad72aee37e5a1411e958d41f1f024a5fd0000000100000fc8
 by scrolling from the bottom of the screen.

       -C or --CLEAR‐SCREEN
              Same as -c, for compatibility with older versions of less.

       -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 less on a dumb terminal.

       -Dxcolor or --color=xcolor
              Changes the color of different parts of the displayed text.  x is a single character which selects the type of text whose color is being set:

              B      Binary characters.

              C      Control characters.

              E      Errors and informational messages.

              M      Mark letters in the status column.

              N      Line numbers enabled via the -N option.

              P      Prompts.

              R      The rscroll character.

              S      Search results.

              W      The highlight enabled via the -w option.

              d      Bold text.

              k      Blinking text.

              s      Standout text.

              u      Underlined text.

              The uppercase letters 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 exam‐
              ple,  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), not to text using ANSI escape sequences with the -R option.

              A lowercase letter may be followed by a + to indicate that both 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.

              color is either a 4‐bit color string or an 8‐bit color string:

              A 4‐bit color string is zero, one or two characters, where the first character specifies the foreground color and the second specifies the background color as follows:

              b      Blue

              c      Cyan

              g      Green

              k      Black

              m      Magenta

              r      Red

              w      White

              y      Yellow

              The corresponding upper‐case 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.  If either character is a "‐" or is omitted, the corresponding color is set to that of normal text.

              An  8‐bit color string is one or two decimal integers separated by a dot, where the first integer specifies the foreground color and the second specifies the background color.  Each integer is a value between 0
              and 255 inclusive which selects a "CSI 38;5" color value (see
              https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters) If either integer is a "‐" or is omitted, the corresponding color is set to that of normal text.  On MS‐DOS versions of less, 8‐bit  color  is  not
              supported; instead, decimal values are interpreted as 4‐bit CHAR_INFO.Attributes values (see
              https://docs.microsoft.com/en‐us/windows/console/char‐info‐str).

       -e or --quit‐at‐eof
              Causes less to automatically exit the second time it reaches end‐of‐file.  By default, the only way to exit less is via the "q" command.

       -E

Title: Less Command Options: Clearing, Dumb Terminals, Color Customization (Continued), and Quitting
Summary
This section continues detailing command-line options for `less`. It covers options for clearing the screen (-c, -C), handling dumb terminals (-d), customizing text colors (-D), and automatically quitting at the end of a file (-e). The -D option allows users to specify colors for different text elements (binary, control characters, errors, search results, etc.) using either 4-bit or 8-bit color codes. It also explains how to combine colors with text formatting (like underline or bold).