Home Explore Blog CI



man-pages

10th chunk of `less.man`
d8b05c3d7a4f15b1357b9d63ce045a004164a3f06adbebfd0000000100000fde
 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 or --QUIT‐AT‐EOF
              Causes less to automatically exit the first time it reaches end‐of‐file.

       -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, 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.

       -F or --quit‐if‐one‐screen
              Causes less to automatically exit if the entire file can be displayed on the first screen.

       -g or --hilite‐search
              Normally, 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 less to run somewhat faster than the default.

       -G or --HILITE‐SEARCH
              The -G option suppresses all highlighting of strings found by search commands.

       -hn or --max‐back‐scroll=n
              Specifies  a  maximum  number  of  lines to scroll backward.  If it is necessary to scroll backward more than n lines, the screen is repainted in a forward direction instead.  (If the terminal does not have the
              ability to scroll backward, -h0 is implied.)

       -i or --ignore‐case
              Causes searches to ignore case; that is, uppercase and lowercase are considered identical.  This option is ignored if any uppercase letters appear in the search pattern; in other words, if  a  pattern  contains
              uppercase letters, then that search does not ignore case.

       -I or --IGNORE‐CASE
              Like -i, but searches ignore case even if the pattern contains uppercase letters.

       -jn or --jump‐target=n
              Specifies  a  line  on  the screen where the "target" line is to be positioned.  The target line is the line specified by any command to search for a pattern, jump to a line number, jump to a file percentage or
              jump to a tag.  The screen line may be specified by a number: the top line on the screen is 1, the next is 2, and so on.  The number may be negative to specify a line relative to the bottom of the  screen:  the
              bottom  line on the screen is -1, the second to the bottom is -2, and so on.  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  tar‐
              get  line  remains at the specified fraction of the screen height.  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,
             

Title: Less Command Options: Color, Quitting, Forcing, Screen Size, Search Highlighting, Scrolling, Case Sensitivity, and Jump Target
Summary
This section details more command-line options for `less`. It covers specifying colors using 8-bit color codes (-D), different behaviors for quitting at the end of the file (-e, -E), forcing the opening of non-regular files (-f), quitting if the file fits on one screen (-F), controlling search highlighting (-g, -G), setting the maximum backward scroll limit (-h), ignoring case in searches (-i, -I), and specifying the screen position of the "target" line for searches and jumps (-j).