home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / less2912.zip / less.man < prev    next >
Text File  |  1995-11-09  |  60KB  |  1,519 lines

  1.  
  2.  
  3.  
  4. LESS(1)                                                   LESS(1)
  5.  
  6.  
  7. NNAAMMEE
  8.        less - opposite of more
  9.  
  10. SSYYNNOOPPSSIISS
  11.        lleessss --??
  12.        lleessss --VV
  13.        lleessss [[--[[++]]aaBBccCCddeeEEffggGGiiIImmMMnnNNqqQQrrssSSuuUUVVwwXX]]
  14.             [[--bb _b_u_f_s]] [[--hh _l_i_n_e_s]] [[--jj _l_i_n_e]] [[--kk _k_e_y_f_i_l_e]]
  15.             [[--{{ooOO}} _l_o_g_f_i_l_e]] [[--pp _p_a_t_t_e_r_n]] [[--PP _p_r_o_m_p_t]] [[--tt _t_a_g]]
  16.             [[--TT _t_a_g_s_f_i_l_e]] [[--xx _t_a_b]] [[--yy _l_i_n_e_s]] [[--[[zz]] _l_i_n_e_s]]
  17.             [[++[[++]]_c_m_d]] [[_f_i_l_e_n_a_m_e]]......
  18.  
  19.  
  20. DDEESSCCRRIIPPTTIIOONN
  21.        _L_e_s_s  is  a  program similar to _m_o_r_e (1), but which allows
  22.        backward movement in the file as well as forward movement.
  23.        Also,  _l_e_s_s  does  not  have to read the entire input file
  24.        before starting, so with large input files  it  starts  up
  25.        faster  than  text editors like _v_i (1).  _L_e_s_s uses termcap
  26.        (or terminfo on some systems), so it can run on a  variety
  27.        of  terminals.  There is even limited support for hardcopy
  28.        terminals.  (On a hardcopy terminal, lines which should be
  29.        printed  at  the  top  of  the  screen are prefixed with a
  30.        caret.)
  31.  
  32.        Commands are based on both _m_o_r_e and _v_i_.  Commands  may  be
  33.        preceded by a decimal number, called N in the descriptions
  34.        below.  The number is used by some commands, as indicated.
  35.  
  36.  
  37. CCOOMMMMAANNDDSS
  38.        In  the  following  descriptions, ^X means control-X.  ESC
  39.        stands for the ESCAPE key; for example ESC-v means the two
  40.        character sequence "ESCAPE", then "v".
  41.  
  42.        h or H Help:  display a summary of these commands.  If you
  43.               forget all the other commands, remember this one.
  44.  
  45.  
  46.        SPACE or ^V or f or ^F
  47.               Scroll forward N lines,  default  one  window  (see
  48.               option  -z  below).   If  N is more than the screen
  49.               size, only the final screenful is displayed.  Warn-
  50.               ing:  some  systems use ^V as a special literaliza-
  51.               tion character.
  52.  
  53.  
  54.        z      Like SPACE, but if N is specified, it  becomes  the
  55.               new window size.
  56.  
  57.  
  58.        RETURN or ^N or e or ^E or j or ^J
  59.               Scroll  forward  N  lines, default 1.  The entire N
  60.               lines are displayed, even if N  is  more  than  the
  61.  
  62.  
  63.  
  64.                                                                 1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. LESS(1)                                                   LESS(1)
  71.  
  72.  
  73.               screen size.
  74.  
  75.  
  76.        d or ^D
  77.               Scroll  forward  N  lines,  default one half of the
  78.               screen size.  If N is specified, it becomes the new
  79.               default for subsequent d and u commands.
  80.  
  81.  
  82.        b or ^B or ESC-v
  83.               Scroll  backward  N  lines, default one window (see
  84.               option -z below).  If N is  more  than  the  screen
  85.               size, only the final screenful is displayed.
  86.  
  87.  
  88.        w      Like  ESC-v,  but if N is specified, it becomes the
  89.               new window size.
  90.  
  91.  
  92.        y or ^Y or ^P or k or ^K
  93.               Scroll backward N lines, default 1.  The  entire  N
  94.               lines  are  displayed,  even  if N is more than the
  95.               screen size.  Warning: some systems  use  ^Y  as  a
  96.               special job control character.
  97.  
  98.  
  99.        u or ^U
  100.               Scroll  backward  N  lines, default one half of the
  101.               screen size.  If N is specified, it becomes the new
  102.               default for subsequent d and u commands.
  103.  
  104.  
  105.        r or ^R or ^L
  106.               Repaint the screen.
  107.  
  108.  
  109.        R      Repaint  the screen, discarding any buffered input.
  110.               Useful if the file is changing while  it  is  being
  111.               viewed.
  112.  
  113.  
  114.        F      Scroll  forward,  and  keep trying to read when the
  115.               end of file  is  reached.   Normally  this  command
  116.               would  be used when already at the end of the file.
  117.               It is a way to monitor the tail of a file which  is
  118.               growing while it is being viewed.  (The behavior is
  119.               similar to the "tail -f" command.)
  120.  
  121.  
  122.        g or < or ESC-<
  123.               Go to line N in the file, default 1  (beginning  of
  124.               file).   (Warning: this may be slow if N is large.)
  125.  
  126.  
  127.  
  128.  
  129.  
  130.                                                                 2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. LESS(1)                                                   LESS(1)
  137.  
  138.  
  139.        G or > or ESC->
  140.               Go to line N in the file, default the  end  of  the
  141.               file.  (Warning: this may be slow if N is large, or
  142.               if N is not specified and  standard  input,  rather
  143.               than a file, is being read.)
  144.  
  145.  
  146.        p or % Go to a position N percent into the file.  N should
  147.               be between 0 and 100.
  148.  
  149.  
  150.        {      If a left curly bracket appears  in  the  top  line
  151.               displayed  on  the screen, the { command will go to
  152.               the matching right  curly  bracket.   The  matching
  153.               right  curly  bracket  is  positioned on the bottom
  154.               line of the screen.  If there is more than one left
  155.               curly  bracket  on  the top line, a number N may be
  156.               used to specify the N-th bracket on the line.
  157.  
  158.  
  159.        }      If a right curly bracket appears in the bottom line
  160.               displayed  on  the screen, the } command will go to
  161.               the matching left curly bracket.  The matching left
  162.               curly  bracket is positioned on the top line of the
  163.               screen.  If there is  more  than  one  right  curly
  164.               bracket  on the top line, a number N may be used to
  165.               specify the N-th bracket on the line.
  166.  
  167.  
  168.        (      Like {, but  applies  to  parentheses  rather  than
  169.               curly brackets.
  170.  
  171.  
  172.        )      Like  },  but  applies  to  parentheses rather than
  173.               curly brackets.
  174.  
  175.  
  176.        [      Like {, but applies to square brackets rather  than
  177.               curly brackets.
  178.  
  179.  
  180.        ]      Like  }, but applies to square brackets rather than
  181.               curly brackets.
  182.  
  183.  
  184.        ESC-^F Followed by two characters, acts like {,  but  uses
  185.               the  two  characters  as  open  and close brackets,
  186.               respectively.  For example, "ESC ^F < >"  could  be
  187.               used  to go forward to the > which matches the < in
  188.               the top displayed line.
  189.  
  190.        ESC-^B Followed by two characters, acts like },  but  uses
  191.               the  two  characters  as  open  and close brackets,
  192.               respectively.  For example, "ESC ^B < >"  could  be
  193.  
  194.  
  195.  
  196.                                                                 3
  197.  
  198.  
  199.  
  200.  
  201.  
  202. LESS(1)                                                   LESS(1)
  203.  
  204.  
  205.               used to go backward to the < which matches the > in
  206.               the bottom displayed line.
  207.  
  208.        m      Followed by any lowercase letter, marks the current
  209.               position with that letter.
  210.  
  211.  
  212.        '      (Single  quote.)  Followed by any lowercase letter,
  213.               returns to the position which was previously marked
  214.               with  that  letter.   Followed  by  another  single
  215.               quote, returns to the position at  which  the  last
  216.               "large" movement command was executed.  Followed by
  217.               a ^ or $, jumps to the beginning or end of the file
  218.               respectively.   Marks are preserved when a new file
  219.               is examined, so the ' command can be used to switch
  220.               between input files.
  221.  
  222.  
  223.        ^X^X   Same as single quote.
  224.  
  225.  
  226.        /pattern
  227.               Search  forward  in the file for the N-th line con-
  228.               taining the pattern.  N defaults to 1.  The pattern
  229.               is  a regular expression, as recognized by _e_d_.  The
  230.               search starts at the second line displayed (but see
  231.               the -a and -j options, which change this).
  232.  
  233.               Certain  characters  are  special if entered at the
  234.               beginning of the pattern; they modify the  type  of
  235.               search rather than become part of the pattern:
  236.  
  237.               !      Search for lines which do NOT match the pat-
  238.                      tern.
  239.  
  240.               *      Search multiple  files.   That  is,  if  the
  241.                      search  reaches  the end of the current file
  242.                      without finding a match, the search  contin-
  243.                      ues  in  the  next  file in the command line
  244.                      list.
  245.  
  246.               @      Begin the search at the first  line  of  the
  247.                      first file in the command line list, regard-
  248.                      less of what is currently displayed  on  the
  249.                      screen  or  the  settings  of  the  -a or -j
  250.                      options.
  251.  
  252.  
  253.        ?pattern
  254.               Search backward in the file for the N-th line  con-
  255.               taining the pattern.  The search starts at the line
  256.               immediately before the top line displayed.
  257.  
  258.               Certain characters are special as in the / command:
  259.  
  260.  
  261.  
  262.                                                                 4
  263.  
  264.  
  265.  
  266.  
  267.  
  268. LESS(1)                                                   LESS(1)
  269.  
  270.  
  271.               !      Search for lines which do NOT match the pat-
  272.                      tern.
  273.  
  274.               *      Search multiple  files.   That  is,  if  the
  275.                      search  reaches the beginning of the current
  276.                      file without finding  a  match,  the  search
  277.                      continues  in  the previous file in the com-
  278.                      mand line list.
  279.  
  280.               @      Begin the search at the  last  line  of  the
  281.                      last  file in the command line list, regard-
  282.                      less of what is currently displayed  on  the
  283.                      screen  or  the  settings  of  the  -a or -j
  284.                      options.
  285.  
  286.  
  287.        ESC-/pattern
  288.               Same as "/*".
  289.  
  290.  
  291.        ESC-?pattern
  292.               Same as "?*".
  293.  
  294.  
  295.        n      Repeat previous search, for  N-th  line  containing
  296.               the last pattern.  If the previous search was modi-
  297.               fied by !, the search is made for the N-th line NOT
  298.               containing the pattern.  If the previous search was
  299.               modified by *, the search continues in the next (or
  300.               previous)  file  if  not  satisfied  in the current
  301.               file.  There is no effect if  the  previous  search
  302.               was modified by @.
  303.  
  304.  
  305.        N      Repeat  previous  search, but in the reverse direc-
  306.               tion.
  307.  
  308.  
  309.        ESC-n  Repeat previous search, but  crossing  file  bound-
  310.               aries.   The  effect  is  as if the previous search
  311.               were modified by *.
  312.  
  313.  
  314.        ESC-N  Repeat previous search, but in the  reverse  direc-
  315.               tion and crossing file boundaries.
  316.  
  317.  
  318.        ESC-u  Undo search highlighting.  Turn off highlighting of
  319.               strings matching the current  search  pattern.   If
  320.               highlighting  is  already off because of a previous
  321.               ESC-u command,  turn  highlighting  back  on.   Any
  322.               search command will also turn highlighting back on.
  323.               (Highlighting can also be disabled by toggling  the
  324.               -G  flag;  in that case search commands do not turn
  325.  
  326.  
  327.  
  328.                                                                 5
  329.  
  330.  
  331.  
  332.  
  333.  
  334. LESS(1)                                                   LESS(1)
  335.  
  336.  
  337.               highlighting back on.)
  338.  
  339.  
  340.        :e [filename]
  341.               Examine a new file.  If the  filename  is  missing,
  342.               the  "current"  file  (see  the  :n and :p commands
  343.               below) from the list of files in the  command  line
  344.               is re-examined.  A percent sign (%) in the filename
  345.               is replaced by the name of  the  current  file.   A
  346.               pound  sign (#) is replaced by the name of the pre-
  347.               viously examined file.  The  filename  is  inserted
  348.               into  the command line list of files so that it can
  349.               be seen by subsequent :n and :p commands.   If  the
  350.               filename  consists  of  several files, they are all
  351.               inserted into the list of files and the  first  one
  352.               is examined.
  353.  
  354.  
  355.        ^X^V or E
  356.               Same as :e.  Warning: some systems use ^V as a spe-
  357.               cial literalization character.
  358.  
  359.  
  360.        :n     Examine the next file (from the list of files given
  361.               in  the command line).  If a number N is specified,
  362.               the N-th next file is examined.
  363.  
  364.  
  365.        :p     Examine the previous file in the command line list.
  366.               If  a number N is specified, the N-th previous file
  367.               is examined.
  368.  
  369.  
  370.        :x     Examine the first file in the  command  line  list.
  371.               If  a  number  N is specified, the N-th file in the
  372.               list is examined.
  373.  
  374.  
  375.        = or ^G or :f
  376.               Prints  some  information  about  the  file   being
  377.               viewed,  including its name and the line number and
  378.               byte offset of the bottom line being displayed.  If
  379.               possible,  it  also  prints the length of the file,
  380.               the number of lines in the file and the percent  of
  381.               the file above the last displayed line.
  382.  
  383.  
  384.        -      Followed  by one of the command line option letters
  385.               (see below), this will change the setting  of  that
  386.               option  and print a message describing the new set-
  387.               ting.  If the option letter  has  a  numeric  value
  388.               (such  as  -b or -h), or a string value (such as -P
  389.               or -t), a new value may be entered after the option
  390.               letter.   If  no  new  value  is entered, a message
  391.  
  392.  
  393.  
  394.                                                                 6
  395.  
  396.  
  397.  
  398.  
  399.  
  400. LESS(1)                                                   LESS(1)
  401.  
  402.  
  403.               describing the current setting is printed and noth-
  404.               ing is changed.
  405.  
  406.  
  407.        -+     Followed  by one of the command line option letters
  408.               (see below), this will  reset  the  option  to  its
  409.               default  setting and print a message describing the
  410.               new setting.  (The  "-+_X"  command  does  the  same
  411.               thing as "-+_X" on the command line.)  This does not
  412.               work for string-valued options.
  413.  
  414.  
  415.        --     Followed by one of the command line option  letters
  416.               (see  below),  this  will  reset  the option to the
  417.               "opposite" of its default setting and print a  mes-
  418.               sage  describing  the new setting.  (The "--_X" com-
  419.               mand does the same thing as  "-_X"  on  the  command
  420.               line.)   This  does not work for numeric or string-
  421.               valued options.
  422.  
  423.  
  424.        _      (Underscore.)  Followed by one of the command  line
  425.               option  letters (see below), this will print a mes-
  426.               sage describing the current setting of that option.
  427.               The setting of the option is not changed.
  428.  
  429.  
  430.        +cmd   Causes the specified cmd to be executed each time a
  431.               new file is examined.  For example, +G causes  _l_e_s_s
  432.               to  initially display each file starting at the end
  433.               rather than the beginning.
  434.  
  435.  
  436.        V      Prints the version number of _l_e_s_s being run.
  437.  
  438.  
  439.        q or :q or :Q or ZZ
  440.               Exits _l_e_s_s_.
  441.  
  442.        The following three commands may  or  may  not  be  valid,
  443.        depending on your particular installation.
  444.  
  445.  
  446.        v      Invokes  an  editor  to edit the current file being
  447.               viewed.  The editor is taken from  the  environment
  448.               variable  VISUAL if defined, or EDITOR if VISUAL is
  449.               not defined, or defaults to "vi" if neither  VISUAL
  450.               nor  EDITOR is defined.  See also the discussion of
  451.               LESSEDIT under the section on PROMPTS below.
  452.  
  453.  
  454.        ! shell-command
  455.               Invokes a shell to run the shell-command given.   A
  456.               percent  sign (%) in the command is replaced by the
  457.  
  458.  
  459.  
  460.                                                                 7
  461.  
  462.  
  463.  
  464.  
  465.  
  466. LESS(1)                                                   LESS(1)
  467.  
  468.  
  469.               name of the current file.   A  pound  sign  (#)  is
  470.               replaced  by  the  name  of the previously examined
  471.               file.  "!!" repeats the last  shell  command.   "!"
  472.               with  no  shell command simply invokes a shell.  In
  473.               all cases, the shell is taken from the  environment
  474.               variable SHELL, or defaults to "sh".
  475.  
  476.  
  477.        | <m> shell-command
  478.               <m> represents any mark letter.  Pipes a section of
  479.               the input file to the  given  shell  command.   The
  480.               section  of  the  file  to  be piped is between the
  481.               first line on the current screen and  the  position
  482.               marked  by  the  letter.  <m> may also be ^ or $ to
  483.               indicate beginning or end of file respectively.  If
  484.               <m> is . or newline, the current screen is piped.
  485.  
  486.  
  487. OOPPTTIIOONNSS
  488.        Command  line  options  are described below.  Most options
  489.        may be changed while _l_e_s_s is running, via the "-" command.
  490.  
  491.        Options  are  also  taken  from  the  environment variable
  492.        "LESS".  For example, to avoid typing "less -options  ..."
  493.        each time _l_e_s_s is invoked, you might tell _c_s_h_:
  494.  
  495.        setenv LESS "-options"
  496.  
  497.        or if you use _s_h_:
  498.  
  499.        LESS="-options"; export LESS
  500.  
  501.        The  environment  variable  is  parsed  before the command
  502.        line, so command line options override the  LESS  environ-
  503.        ment variable.  If an option appears in the LESS variable,
  504.        it can be reset to its default  on  the  command  line  by
  505.        beginning the command line option with "-+".
  506.  
  507.        A  dollar  sign  ($)  may  be used to signal the end of an
  508.        option string.  This is important only for options like -P
  509.        which take a following string.
  510.  
  511.        -?     This  option  displays  a  summary  of the commands
  512.               accepted by _l_e_s_s (the same as the h  command).   If
  513.               this   option  is  given,  all  other  options  are
  514.               ignored, and _l_e_s_s exits after the  help  screen  is
  515.               viewed.   (Depending  on  how your shell interprets
  516.               the question mark, it may be necessary to quote the
  517.               question mark, thus: "-\?".)
  518.  
  519.        -a     Causes  searches  to start after the last line dis-
  520.               played on the screen, thus skipping all lines  dis-
  521.               played  on  the screen.  By default, searches start
  522.               at the second line on the screen (or after the last
  523.  
  524.  
  525.  
  526.                                                                 8
  527.  
  528.  
  529.  
  530.  
  531.  
  532. LESS(1)                                                   LESS(1)
  533.  
  534.  
  535.               found line; see the -j option).
  536.  
  537.        -b_n    Specifies  the  number of buffers _l_e_s_s will use for
  538.               each file.  Buffers  are  1K,  and  by  default  10
  539.               buffers  are used for each file (except if the file
  540.               is a pipe; see the -B option).  The number _n speci-
  541.               fies a different number of buffers to use.
  542.  
  543.        -B     By  default, when data is read from a pipe, buffers
  544.               are allocated automatically as needed.  If a  large
  545.               amount  of  data  is  read  from the pipe, this can
  546.               cause a large amount of  memory  to  be  allocated.
  547.               The -B option disables this automatic allocation of
  548.               buffers for pipes,  so  that  only  the  number  of
  549.               buffers specified by the -b option are used.  Warn-
  550.               ing: use of -B can  result  in  erroneous  display,
  551.               since  only  the  most  recently viewed part of the
  552.               file is kept in memory; any earlier data is lost.
  553.  
  554.        -c     Causes full screen repaints to be painted from  the
  555.               top  line  down.   By default, full screen repaints
  556.               are done  by  scrolling  from  the  bottom  of  the
  557.               screen.
  558.  
  559.        -C     The -C option is like -c, but the screen is cleared
  560.               before it is repainted.
  561.  
  562.        -d     The -d option suppresses the error message normally
  563.               displayed  if  the terminal is dumb; that is, lacks
  564.               some important capability, such as the  ability  to
  565.               clear the screen or scroll backward.  The -d option
  566.               does not otherwise change the behavior of _l_e_s_s on a
  567.               dumb terminal).
  568.  
  569.        -Dxx_c_o_l_o_r
  570.               [MS-DOS only] Sets the color of the text displayed.
  571.               xx is a single character which selects the  type  of
  572.               text   whose   color   is   being   set:  n=normal,
  573.               s=standout, d=bold, u=underlined,  k=blink.   _c_o_l_o_r
  574.               is  a  pair  of numbers separated by a period.  The
  575.               first number selects the foreground color  and  the
  576.               second selects the background color of the text.  A
  577.               single number _N is the same as _N_._0.
  578.  
  579.        -e     Causes _l_e_s_s to automatically exit the  second  time
  580.               it  reaches  end-of-file.  By default, the only way
  581.               to exit _l_e_s_s is via the "q" command.
  582.  
  583.        -E     Causes _l_e_s_s to automatically exit the first time it
  584.               reaches end-of-file.
  585.  
  586.        -f     Forces  non-regular  files  to  be opened.  (A non-
  587.               regular file is a directory  or  a  device  special
  588.               file.)   Also suppresses the warning message when a
  589.  
  590.  
  591.  
  592.                                                                 9
  593.  
  594.  
  595.  
  596.  
  597.  
  598. LESS(1)                                                   LESS(1)
  599.  
  600.  
  601.               binary file  is  opened.   By  default,  _l_e_s_s  will
  602.               refuse to open non-regular files.
  603.  
  604.        -g     Normally,  _l_e_s_s  will  highlight  ALL strings which
  605.               match the last search command.  The -g flag changes
  606.               this  behavior  to  highlight  only  the particular
  607.               string which was found by the last search  command.
  608.               This can cause _l_e_s_s to run somewhat faster than the
  609.               default.
  610.  
  611.        -G     The -G flag suppresses all highlighting of  strings
  612.               found by search commands.
  613.  
  614.        -h_n    Specifies a maximum number of lines to scroll back-
  615.               ward.  If it is necessary to scroll  backward  more
  616.               than  _n lines, the screen is repainted in a forward
  617.               direction instead.  (If the terminal does not  have
  618.               the ability to scroll backward, -h0 is implied.)
  619.  
  620.        -i     Causes  searches to ignore case; that is, uppercase
  621.               and  lowercase  are  considered  identical.    This
  622.               option  is  ignored if any uppercase letters appear
  623.               in the search pattern; in other words, if a pattern
  624.               contains  uppercase  letters, then that search does
  625.               not ignore case.
  626.  
  627.        -I     Like -i, but searches ignore case even if the  pat-
  628.               tern contains uppercase letters.
  629.  
  630.        -j_n    Specifies  a  line on the screen where the "target"
  631.               line is to be positioned.  A  target  line  is  the
  632.               object of a text search, tag search, jump to a line
  633.               number, jump to a file percentage,  or  jump  to  a
  634.               marked position.  The screen line is specified by a
  635.               number: the top line on the screen is 1,  the  next
  636.               is  2,  and  so  on.  The number may be negative to
  637.               specify a  line  relative  to  the  bottom  of  the
  638.               screen:  the  bottom  line on the screen is -1, the
  639.               second to the bottom is -2, and so on.  If  the  -j
  640.               option  is used, searches begin at the line immedi-
  641.               ately after the target line.  For example, if "-j4"
  642.               is  used, the target line is the fourth line on the
  643.               screen, so searches begin at the fifth line on  the
  644.               screen.
  645.  
  646.        -k_f_i_l_e_n_a_m_e
  647.               Causes _l_e_s_s to open and interpret the named file as
  648.               a _l_e_s_s_k_e_y (1) file.  Multiple  -k  options  may  be
  649.               specified.   If  a  file called .less exists in the
  650.               user's home directory, this file is also used as  a
  651.               _l_e_s_s_k_e_y file.
  652.  
  653.        -m     Causes  _l_e_s_s  to prompt verbosely (like _m_o_r_e), with
  654.               the  percent  into  the  file.   By  default,  _l_e_s_s
  655.  
  656.  
  657.  
  658.                                                                10
  659.  
  660.  
  661.  
  662.  
  663.  
  664. LESS(1)                                                   LESS(1)
  665.  
  666.  
  667.               prompts with a colon.
  668.  
  669.        -M     Causes  _l_e_s_s  to  prompt  even  more verbosely than
  670.               _m_o_r_e_.
  671.  
  672.        -n     Suppresses line numbers.  The default (to use  line
  673.               numbers)  may cause _l_e_s_s to run more slowly in some
  674.               cases, especially with a  very  large  input  file.
  675.               Suppressing  line  numbers  with  the  -n flag will
  676.               avoid this problem.  Using line numbers means:  the
  677.               line number will be displayed in the verbose prompt
  678.               and in the = command, and the v command  will  pass
  679.               the current line number to the editor (see also the
  680.               discussion of LESSEDIT in PROMPTS below).
  681.  
  682.        -N     Causes a line number to be displayed at the  begin-
  683.               ning of each line in the display.
  684.  
  685.        -o_f_i_l_e_n_a_m_e
  686.               Causes  _l_e_s_s to copy its input to the named file as
  687.               it is being viewed.  This  applies  only  when  the
  688.               input file is a pipe, not an ordinary file.  If the
  689.               file already exists, _l_e_s_s will ask for confirmation
  690.               before overwriting it.
  691.  
  692.        -O_f_i_l_e_n_a_m_e
  693.               The  -O option is like -o, but it will overwrite an
  694.               existing file without asking for confirmation.
  695.  
  696.               If no log file has been specified, the  -o  and  -O
  697.               options  can  be used from within _l_e_s_s to specify a
  698.               log file.  Without a file name,  they  will  simply
  699.               report  the  name of the log file.  The "s" command
  700.               is equivalent to specifying -o from within _l_e_s_s_.
  701.  
  702.        -p_p_a_t_t_e_r_n
  703.               The -p option on the command line is equivalent  to
  704.               specifying  +/_p_a_t_t_e_r_n;  that  is,  it tells _l_e_s_s to
  705.               start at the first occurrence  of  _p_a_t_t_e_r_n  in  the
  706.               file.
  707.  
  708.        -P_p_r_o_m_p_t
  709.               Provides a way to tailor the three prompt styles to
  710.               your own preference.  This option would normally be
  711.               put  in  the LESS environment variable, rather than
  712.               being typed in with each  _l_e_s_s  command.   Such  an
  713.               option  must  either be the last option in the LESS
  714.               variable, or be terminated by a  dollar  sign.   -P
  715.               followed  by  a  string changes the default (short)
  716.               prompt to that string.  -Pm changes the medium (-m)
  717.               prompt to the string, and -PM changes the long (-M)
  718.               prompt.  Also, -P= changes the message  printed  by
  719.               the  =  command  to  the  given string.  All prompt
  720.               strings  consist  of  a  sequence  of  letters  and
  721.  
  722.  
  723.  
  724.                                                                11
  725.  
  726.  
  727.  
  728.  
  729.  
  730. LESS(1)                                                   LESS(1)
  731.  
  732.  
  733.               special  escape  sequences.   See  the  section  on
  734.               PROMPTS for more details.
  735.  
  736.        -q     Causes moderately "quiet" operation:  the  terminal
  737.               bell  is  not  rung if an attempt is made to scroll
  738.               past the end of the file or before the beginning of
  739.               the  file.  If the terminal has a "visual bell", it
  740.               is used instead.  The bell will be rung on  certain
  741.               other  errors, such as typing an invalid character.
  742.               The default is to ring the  terminal  bell  in  all
  743.               such cases.
  744.  
  745.        -Q     Causes totally "quiet" operation: the terminal bell
  746.               is never rung.
  747.  
  748.        -r     Causes "raw" control characters  to  be  displayed.
  749.               The  default is to display control characters using
  750.               the caret notation; for example, a control-A (octal
  751.               001)  is  displayed  as "^A".  Warning: when the -r
  752.               flag is used, _l_e_s_s cannot keep track of the  actual
  753.               appearance of the screen (since this depends on how
  754.               the screen responds to each type of control charac-
  755.               ter).   Thus,  various display problems may result,
  756.               such as long lines being split in the wrong  place.
  757.  
  758.        -s     Causes  consecutive blank lines to be squeezed into
  759.               a single blank line.  This is useful  when  viewing
  760.               _n_r_o_f_f output.
  761.  
  762.        -S     Causes  lines  longer  than  the screen width to be
  763.               chopped rather than folded.  That is, the remainder
  764.               of a long line is simply discarded.  The default is
  765.               to fold long lines; that is, display the  remainder
  766.               on the next line.
  767.  
  768.        -t_t_a_g  The  -t option, followed immediately by a TAG, will
  769.               edit the file containing that  tag.   For  this  to
  770.               work,  there  must  be  a file called "tags" in the
  771.               current directory, which was  previously  built  by
  772.               the  _c_t_a_g_s  (1)  command.   This option may also be
  773.               specified from within _l_e_s_s (using the - command) as
  774.               a way of examining a new file.  The command ":t" is
  775.               equivalent to specifying -t from within _l_e_s_s_.
  776.  
  777.        -T_t_a_g_s_f_i_l_e
  778.               Specifies a tags file to be used instead of "tags".
  779.  
  780.        -u     Causes   backspaces  and  carriage  returns  to  be
  781.               treated as printable characters; that is, they  are
  782.               sent to the terminal when they appear in the input.
  783.  
  784.        -U     Causes  backspaces  and  carriage  returns  to   be
  785.               treated  as  control  characters; that is, they are
  786.               handled as specified by the -r option.
  787.  
  788.  
  789.  
  790.                                                                12
  791.  
  792.  
  793.  
  794.  
  795.  
  796. LESS(1)                                                   LESS(1)
  797.  
  798.  
  799.               By  default,  if  neither  -u  nor  -U  is   given,
  800.               backspaces  which  appear adjacent to an underscore
  801.               character are  treated  specially:  the  underlined
  802.               text  is  displayed  using  the terminal's hardware
  803.               underlining  capability.   Also,  backspaces  which
  804.               appear between two identical characters are treated
  805.               specially: the overstruck text is printed using the
  806.               terminal's  hardware  boldface  capability.   Other
  807.               backspaces are deleted, along  with  the  preceding
  808.               character.   Carriage  returns immediately followed
  809.               by a newline are deleted.  Other  carriage  returns
  810.               are  handled  as  specified by the -r option.  Text
  811.               which is overstruck or underlined can  be  searched
  812.               for if neither -u nor -U is in effect.
  813.  
  814.        -V     Displays the version number of _l_e_s_s_.
  815.  
  816.        -w     Causes  blank  lines  to be used to represent lines
  817.               past the end of the  file.   By  default,  a  tilde
  818.               character (~) is used.
  819.  
  820.        -x_n    Sets  tab stops every _n positions.  The default for
  821.               _n is 8.
  822.  
  823.        -X     Disables sending  the  termcap  initialization  and
  824.               deinitialization  strings to the terminal.  This is
  825.               sometimes desirable if the deinitialization  string
  826.               does   something  unnecessary,  like  clearing  the
  827.               screen.
  828.  
  829.        -y_n    Specifies a maximum number of lines to scroll  for-
  830.               ward.   If  it  is necessary to scroll forward more
  831.               than _n lines, the screen is repainted instead.  The
  832.               -c or -C option may be used to repaint from the top
  833.               of the screen if desired.  By default, any  forward
  834.               movement causes scrolling.
  835.  
  836.        -[z]_n  Changes  the  default  scrolling  window  size to _n
  837.               lines.  The default is one screenful.  The z and  w
  838.               commands  can  also  be  used  to change the window
  839.               size.  The "z" may  be  omitted  for  compatibility
  840.               with  _m_o_r_e_.   If the number _n is negative, it indi-
  841.               cates _n lines less than the  current  screen  size.
  842.               For  example,  if the screen is 24 lines, _-_z_-_4 sets
  843.               the scrolling window to 20 lines.  If the screen is
  844.               resized to 40 lines, the scrolling window automati-
  845.               cally changes to 36 lines.
  846.  
  847.        +      If a command line option begins with ++, the remain-
  848.               der  of  that option is taken to be an initial com-
  849.               mand to _l_e_s_s_.  For example, +G tells _l_e_s_s to  start
  850.               at  the  end of the file rather than the beginning,
  851.               and +/xyz tells it to start at the first occurrence
  852.               of "xyz" in the file.  As a special case, +<number>
  853.  
  854.  
  855.  
  856.                                                                13
  857.  
  858.  
  859.  
  860.  
  861.  
  862. LESS(1)                                                   LESS(1)
  863.  
  864.  
  865.               acts like +<number>g; that is, it starts  the  dis-
  866.               play at the specified line number (however, see the
  867.               caveat under the "g" command above).  If the option
  868.               starts  with  ++,  the  initial  command applies to
  869.               every file being viewed, not just  the  first  one.
  870.               The + command described previously may also be used
  871.               to set (or change) an  initial  command  for  every
  872.               file.
  873.  
  874.  
  875. LLIINNEE EEDDIITTIINNGG
  876.        When  entering  command  line  at the bottom of the screen
  877.        (for example, a filename for the :e command, or  the  pat-
  878.        tern  for  a  search command), certain keys can be used to
  879.        manipulate the command line.  Most commands have an alter-
  880.        nate  form in [ brackets ] which can be used if a key does
  881.        not exist on a particular keyboard.  (The bracketed  forms
  882.        do  not work in the MS-DOS version.)  Any of these special
  883.        keys may be entered literally by  preceding  it  with  the
  884.        "literal"  character, either ^V or ^A.  A backslash itself
  885.        may also be entered literally by entering two backslashes.
  886.  
  887.        LEFTARROW [ ESC-h ]
  888.               Move the cursor one space to the left.
  889.  
  890.        RIGHTARROW [ ESC-l ]
  891.               Move the cursor one space to the right.
  892.  
  893.        ^LEFTARROW [ ESC-b or ESC-LEFTARROW ]
  894.               (That  is,  CONTROL  and LEFTARROW simultaneously.)
  895.               Move the cursor one word to the left.
  896.  
  897.        ^RIGHTARROW [ ESC-w or ESC-RIGHTARROW ]
  898.               (That is, CONTROL and  RIGHTARROW  simultaneously.)
  899.               Move the cursor one word to the right.
  900.  
  901.        HOME [ ESC-0 ]
  902.               Move the cursor to the beginning of the line.
  903.  
  904.        END [ ESC-$ ]
  905.               Move the cursor to the end of the line.
  906.  
  907.        BACKSPACE
  908.               Delete  the character to the left of the cursor, or
  909.               cancel the command if the command line is empty.
  910.  
  911.        DELETE or [ ESC-x ]
  912.               Delete the character under the cursor.
  913.  
  914.        ^BACKSPACE [ ESC-BACKSPACE ]
  915.               (That is, CONTROL  and  BACKSPACE  simultaneously.)
  916.               Delete the word to the left of the cursor.
  917.  
  918.  
  919.  
  920.  
  921.  
  922.                                                                14
  923.  
  924.  
  925.  
  926.  
  927.  
  928. LESS(1)                                                   LESS(1)
  929.  
  930.  
  931.        ^DELETE [ ESC-X or ESC-DELETE ]
  932.               (That   is,  CONTROL  and  DELETE  simultaneously.)
  933.               Delete the word under the cursor.
  934.  
  935.        UPARROW [ ESC-k ]
  936.               Retrieve the previous command line.
  937.  
  938.        DOWNARROW [ ESC-j ]
  939.               Retrieve the next command line.
  940.  
  941.        TAB    Complete the partial filename to the  left  of  the
  942.               cursor.   If it matches more than one filename, the
  943.               first match  is  entered  into  the  command  line.
  944.               Repeated  TABs  will  cycle thru the other matching
  945.               filenames.
  946.  
  947.        BACKTAB [ ESC-TAB ]
  948.               Like, TAB, but cycles in the reverse direction thru
  949.               the matching filenames.
  950.  
  951.        ^L     Complete  the  partial  filename to the left of the
  952.               cursor.  If it matches more than one filename,  all
  953.               matches  are entered into the command line (if they
  954.               fit).
  955.  
  956.        ^U (Unix) or ESC (MS-DOS)
  957.               Delete the entire command line, or cancel the  com-
  958.               mand  if  the  command  line is empty.  If you have
  959.               changed your line-kill character in Unix  to  some-
  960.               thing other than ^U, that character is used instead
  961.               of ^U.
  962.  
  963.  
  964. KKEEYY BBIINNDDIINNGGSS
  965.        You may define your own _l_e_s_s commands by using the program
  966.        _l_e_s_s_k_e_y  (1)  to create a file called ".less" in your home
  967.        directory.  This file specifies a set of command keys  and
  968.        an  action  associated  with  each  key.  You may also use
  969.        _l_e_s_s_k_e_y to change the line-editing keys  (see  LINE  EDIT-
  970.        ING).  See the _l_e_s_s_k_e_y manual page for more details.
  971.  
  972.  
  973. IINNPPUUTT PPRREEPPRROOCCEESSSSOORR
  974.        You  may  define an "input preprocessor" for _l_e_s_s_.  Before
  975.        _l_e_s_s opens a file, it first gives your input  preprocessor
  976.        a  chance  to  modify the way the contents of the file are
  977.        displayed.  An input preprocessor is simply an  executable
  978.        program  (or  shell  script), which writes the contents of
  979.        the file to a different file, called the replacement file.
  980.        The contents of the replacement file are then displayed in
  981.        place of the contents of the original file.   However,  it
  982.        will appear to the user as if the original file is opened;
  983.        that is, _l_e_s_s will display the original  filename  as  the
  984.        name of the current file.
  985.  
  986.  
  987.  
  988.                                                                15
  989.  
  990.  
  991.  
  992.  
  993.  
  994. LESS(1)                                                   LESS(1)
  995.  
  996.  
  997.        An  input preprocessor receives one command line argument,
  998.        the original filename, as entered by the user.  It  should
  999.        create  the replacement file, and when finished, print the
  1000.        name of the replacement file to its standard  output.   If
  1001.        the input preprocessor does not output a replacement file-
  1002.        name, _l_e_s_s uses the original file, as normal.   The  input
  1003.        preprocessor  is  not  called when viewing standard input.
  1004.        To set up an input preprocessor, set the LESSOPEN environ-
  1005.        ment  variable  to  a  command line which will invoke your
  1006.        input preprocessor.  This command line should include  one
  1007.        occurrence  of  the string "%s", which will be replaced by
  1008.        the  filename  when  the  input  preprocessor  command  is
  1009.        invoked.
  1010.  
  1011.        When _l_e_s_s closes a file opened in such a way, it will call
  1012.        another program, called the input postprocessor, which may
  1013.        perform  any desired clean-up action (such as deleting the
  1014.        replacement  file  created  by  LESSOPEN).   This  program
  1015.        receives two command line arguments, the original filename
  1016.        as entered by the user, and the name  of  the  replacement
  1017.        file.  To set up an input postprocessor, set the LESSCLOSE
  1018.        environment variable to a command line which  will  invoke
  1019.        your  input postprocessor.  It may include two occurrences
  1020.        of the string "%s"; the first is replaced with the  origi-
  1021.        nal  name  of the file and the second with the name of the
  1022.        replacement file, which was output by LESSOPEN.
  1023.  
  1024.        For example, on many Unix systems, these two scripts  will
  1025.        allow  you  to  keep files in compressed format, but still
  1026.        let _l_e_s_s view them directly:
  1027.  
  1028.        lessopen.sh:
  1029.             #! /bin/sh
  1030.             case "$1" in
  1031.             *.Z) uncompress -c $1  >/tmp/less.$$  2>/dev/null
  1032.                  if [ -s /tmp/less.$$ ]; then
  1033.                       echo /tmp/less.$$
  1034.                  else
  1035.                       rm -f /tmp/less.$$
  1036.                  fi
  1037.                  ;;
  1038.             esac
  1039.  
  1040.        lessclose.sh:
  1041.             #! /bin/sh
  1042.             rm $2
  1043.  
  1044.        To use these scripts, put them both where they can be exe-
  1045.        cuted     and     set    LESSOPEN="lessopen.sh %s",    and
  1046.        LESSCLOSE="lessclose.sh %s %s".  More complex LESSOPEN and
  1047.        LESSCLOSE  scripts may be written to accept other types of
  1048.        compressed files, and so on.
  1049.  
  1050.        It is also possible to set up  an  input  preprocessor  to
  1051.  
  1052.  
  1053.  
  1054.                                                                16
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060. LESS(1)                                                   LESS(1)
  1061.  
  1062.  
  1063.        pipe  the  file data directly to _l_e_s_s_, rather than putting
  1064.        the data into a replacement file.  This avoids the need to
  1065.        decompress the entire file before starting to view it.  An
  1066.        input preprocessor that works this way is called an  input
  1067.        pipe.   An  input  pipe,  instead of writing the name of a
  1068.        replacement file on its standard output, writes the entire
  1069.        contents  of  the replacement file on its standard output.
  1070.        If the input pipe does not write  any  characters  on  its
  1071.        standard  output,  then  there  is no replacement file and
  1072.        _l_e_s_s uses the original file, as normal.  To use  an  input
  1073.        pipe, make the first character in the LESSOPEN environment
  1074.        variable a vertical bar (|) to signify that the input pre-
  1075.        processor is an input pipe.
  1076.  
  1077.        For  example,  on many Unix systems, this script will work
  1078.        like the previous example scripts:
  1079.  
  1080.        lesspipe.sh:
  1081.             !# /bin/sh
  1082.             case "$1" in
  1083.             *.Z) uncompress -c $1  2>/dev/null
  1084.                  ;;
  1085.             esac
  1086.  
  1087.        To use this script, put it where it can  be  executed  and
  1088.        set  LESSOPEN="|lesspipe.sh  %s".   When  an input pipe is
  1089.        used, a LESSCLOSE postprocessor can be  used,  but  it  is
  1090.        usually  not  necessary since there is no replacement file
  1091.        to clean up.  In this  case,  the  replacement  file  name
  1092.        passed to the LESSCLOSE postprocessor is "-".
  1093.  
  1094.  
  1095. NNAATTIIOONNAALL CCHHAARRAACCTTEERR SSEETTSS
  1096.        There are three types of characters in the input file:
  1097.  
  1098.        normal characters
  1099.               can be displayed directly to the screen.
  1100.  
  1101.        control characters
  1102.               should  not be displayed directly, but are expected
  1103.               to  be  found  in  ordinary  text  files  (such  as
  1104.               backspace and tab).
  1105.  
  1106.        binary characters
  1107.               should  not  be  displayed  directly  and  are  not
  1108.               expected to be found in text files.
  1109.  
  1110.        A "character set" is simply a description of which charac-
  1111.        ters  are  to  be  considered normal, control, and binary.
  1112.        The LESSCHARSET environment variable may be used to select
  1113.        a character set.  Possible values for LESSCHARSET are:
  1114.  
  1115.        ascii  The  default  character  set.  BS, TAB, NL, CR, and
  1116.               formfeed are control  characters,  all  chars  with
  1117.  
  1118.  
  1119.  
  1120.                                                                17
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126. LESS(1)                                                   LESS(1)
  1127.  
  1128.  
  1129.               values between 127 and 255 are binary, and all oth-
  1130.               ers are normal.
  1131.  
  1132.        latin1 Selects the ISO 8859/1 character set.   latin-1  is
  1133.               the  same  as  ASCII, except characters between 161
  1134.               and 255 are treated as normal characters.
  1135.  
  1136.        dos    Selects a character set appropriate for MS-DOS.
  1137.  
  1138.        koi8-r Selects a Russian character set.
  1139.  
  1140.        next   Selects a character set appropriate for  NeXT  com-
  1141.               puters.
  1142.  
  1143.        In  special cases, it may be desired to tailor _l_e_s_s to use
  1144.        a character set other than the  ones  definable  by  LESS-
  1145.        CHARSET.   In  this  case,  the environment variable LESS-
  1146.        CHARDEF can be used to define a character set.  It  should
  1147.        be set to a string where each character in the string rep-
  1148.        resents one character in the character set.  The character
  1149.        "."  is  used for a normal character, "c" for control, and
  1150.        "b" for binary.  A decimal number may be used for  repeti-
  1151.        tion.   For  example,  "bccc4b." would mean character 0 is
  1152.        binary, 1, 2 and 3 are control, 4, 5, 6 and 7 are  binary,
  1153.        and  8 is normal.  All characters after the last are taken
  1154.        to be the same as the last, so characters  9  through  255
  1155.        would be normal.  (This is an example, and does not neces-
  1156.        sarily represent any real character set.)
  1157.  
  1158.        This table shows the value of LESSCHARDEF which is equiva-
  1159.        lent to each of the possible values for LESSCHARSET:
  1160.  
  1161.             ascii     8bcccbcc18b95.b
  1162.             latin1    8bcccbcc18b95.33b.
  1163.             dos       8bcccbcc12bc5b95.b.
  1164.             koi8-r    8bcccbcc18b95.b128.
  1165.             next      8bcccbcc18b95.bb125.bb
  1166.  
  1167.        If  neither  LESSCHARSET  nor LESSCHARDEF is set, but your
  1168.        system supports the _s_e_t_l_o_c_a_l_e  interface,  _l_e_s_s  will  use
  1169.        setlocale  to  determine  the character set.  setlocale is
  1170.        controlled by setting the  LANG  or  LC_CTYPE  environment
  1171.        variables.
  1172.  
  1173.        Control  and  binary  characters are displayed in standout
  1174.        (reverse video).  Each  such  character  is  displayed  in
  1175.        caret notation if possible (e.g. ^A for control-A).  Caret
  1176.        notation is used only if inverting the 0100 bit results in
  1177.        a normal printable character.  Otherwise, the character is
  1178.        displayed as a hex number in angle brackets.  This  format
  1179.        can be changed by setting the LESSBINFMT environment vari-
  1180.        able.  LESSBINFMT may begin with a "*" and  one  character
  1181.        to select the display attribute: "*k" is blinking, "*d" is
  1182.        bold, "*u" is underlined, "*s" is standout.  If LESSBINFMT
  1183.  
  1184.  
  1185.  
  1186.                                                                18
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192. LESS(1)                                                   LESS(1)
  1193.  
  1194.  
  1195.        does  not  begin  with a "*", normal attribute is assumed.
  1196.        The remainder of LESSBINFMT is a string which may  include
  1197.        one printf-style escape sequence (a % followed by x, X, o,
  1198.        d, etc.).  For example, if LESSBINFMT is "*u[%x]",  binary
  1199.        characters  are  displayed  in underlined hexadecimal sur-
  1200.        rounded by brackets.  The  default  if  no  LESSBINFMT  is
  1201.        specified is "*d<%X>".
  1202.  
  1203.  
  1204. PPRROOMMPPTTSS
  1205.        The  -P  option  allows  you  to tailor the prompt to your
  1206.        preference.  The string given to the  -P  option  replaces
  1207.        the  specified  prompt  string.  Certain characters in the
  1208.        string are interpreted specially.  The prompt mechanism is
  1209.        rather  complicated  to provide flexibility, but the ordi-
  1210.        nary user need not understand the details of  constructing
  1211.        personalized prompt strings.
  1212.  
  1213.        A  percent sign followed by a single character is expanded
  1214.        according to what the following character is:
  1215.  
  1216.        %b_X    Replaced by the byte offset into the current  input
  1217.               file.   The  b  is  followed  by a single character
  1218.               (shown as _X above) which specifies the  line  whose
  1219.               byte  offset  is to be used.  If the character is a
  1220.               "t", the byte offset of the top line in the display
  1221.               is  used,  an  "m" means use the middle line, a "b"
  1222.               means use the bottom line, a "B" means use the line
  1223.               just after the bottom line, and a "j" means use the
  1224.               "target" line, as specified by the -j option.
  1225.  
  1226.        %B     Replaced by the size of the current input file.
  1227.  
  1228.        %E     Replaced by the name of the editor (from the VISUAL
  1229.               environment  variable,  or  the  EDITOR environment
  1230.               variable if VISUAL is not defined).  See  the  dis-
  1231.               cussion of the LESSEDIT feature below.
  1232.  
  1233.        %f     Replaced by the name of the current input file.
  1234.  
  1235.        %i     Replaced  by  the  index of the current file in the
  1236.               list of input files.
  1237.  
  1238.        %l_X    Replaced by the line number of a line in the  input
  1239.               file.   The line to be used is determined by the _X,
  1240.               as with the %b option.
  1241.  
  1242.        %L     Replaced by the line number of the last line in the
  1243.               input file.
  1244.  
  1245.        %m     Replaced by the total number of input files.
  1246.  
  1247.        %p_X    Replaced  by  the  percent  into  the current input
  1248.               file.  The line used is determined by the _X as with
  1249.  
  1250.  
  1251.  
  1252.                                                                19
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258. LESS(1)                                                   LESS(1)
  1259.  
  1260.  
  1261.               the %b option.
  1262.  
  1263.        %s     Same as %B.
  1264.  
  1265.        %t     Causes  any trailing spaces to be removed.  Usually
  1266.               used at the end of the string, but may appear  any-
  1267.               where.
  1268.  
  1269.        %x     Replaced  by the name of the next input file in the
  1270.               list.
  1271.  
  1272.        If any item is unknown (for  example,  the  file  size  if
  1273.        input is a pipe), a question mark is printed instead.
  1274.  
  1275.        The  format  of the prompt string can be changed depending
  1276.        on certain conditions.  A question mark followed by a sin-
  1277.        gle  character acts like an "IF": depending on the follow-
  1278.        ing character, a condition is evaluated.  If the condition
  1279.        is  true,  any  characters following the question mark and
  1280.        condition character, up to a period, are included  in  the
  1281.        prompt.   If  the  condition is false, such characters are
  1282.        not included.  A colon appearing between the question mark
  1283.        and  the  period  can  be used to establish an "ELSE": any
  1284.        characters between the colon and the period  are  included
  1285.        in  the  string  if and only if the IF condition is false.
  1286.        Condition characters (which follow a  question  mark)  may
  1287.        be:
  1288.  
  1289.        ?a     True  if  any  characters have been included in the
  1290.               prompt so far.
  1291.  
  1292.        ?b_X    True if the byte offset of the  specified  line  is
  1293.               known.
  1294.  
  1295.        ?B     True if the size of current input file is known.
  1296.  
  1297.        ?e     True if at end-of-file.
  1298.  
  1299.        ?f     True  if  there  is  an input filename (that is, if
  1300.               input is not a pipe).
  1301.  
  1302.        ?l_X    True if the line number of the  specified  line  is
  1303.               known.
  1304.  
  1305.        ?L     True  if  the  line  number of the last line in the
  1306.               file is known.
  1307.  
  1308.        ?m     True if there is more than one input file.
  1309.  
  1310.        ?n     True if this is the first prompt  in  a  new  input
  1311.               file.
  1312.  
  1313.        ?p_X    True  if the percent into the current input file of
  1314.               the specified line is known.
  1315.  
  1316.  
  1317.  
  1318.                                                                20
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324. LESS(1)                                                   LESS(1)
  1325.  
  1326.  
  1327.        ?s     Same as "?B".
  1328.  
  1329.        ?x     True if there is a next input file (that is, if the
  1330.               current input file is not the last one).
  1331.  
  1332.        Any characters other than the special ones (question mark,
  1333.        colon, period, percent, and  backslash)  become  literally
  1334.        part  of the prompt.  Any of the special characters may be
  1335.        included in the prompt literally by preceding  it  with  a
  1336.        backslash.
  1337.  
  1338.        Some examples:
  1339.  
  1340.        ?f%f:Standard input.
  1341.  
  1342.        This  prompt  prints the filename, if known; otherwise the
  1343.        string "Standard input".
  1344.  
  1345.        ?f%f .?ltLine %lt:?pt%pt\%:?btByte %bt:-...
  1346.  
  1347.        This prompt would print the filename, if known.  The file-
  1348.        name  is  followed by the line number, if known, otherwise
  1349.        the percent if known, otherwise the byte offset if  known.
  1350.        Otherwise,  a  dash  is printed.  Notice how each question
  1351.        mark has a matching period, and how the % after the %pt is
  1352.        included literally by escaping it with a backslash.
  1353.  
  1354.        ?n?f%f .?m(file %i of %m) ..?e(END) ?x- Next\: %x..%t
  1355.  
  1356.        This  prints the filename if this is the first prompt in a
  1357.        file, followed by the "file N of N" message  if  there  is
  1358.        more than one input file.  Then, if we are at end-of-file,
  1359.        the string "(END)" is printed followed by the name of  the
  1360.        next  file, if there is one.  Finally, any trailing spaces
  1361.        are truncated.  This is the default  prompt.   For  refer-
  1362.        ence,  here are the defaults for the other two prompts (-m
  1363.        and -M respectively).  Each is broken into two lines  here
  1364.        for readability only.
  1365.  
  1366.        ?n?f%f .?m(file %i of %m) ..?e(END) ?x- Next\: %x.:
  1367.             ?pB%pB\%:byte %bB?s/%s...%t
  1368.  
  1369.        ?f%f .?n?m(file %i of %m) ..?ltline %lt?L/%L. :byte %bB?s/%s. .
  1370.             ?e(END) ?x- Next\: %x.:?pB%pB\%..%t
  1371.  
  1372.        And here is the default message produced by the = command:
  1373.  
  1374.        ?f%f .?m(file %i of %m) .?ltline %lt?L/%L. .
  1375.             byte %bB?s/%s. ?e(END) :?pB%pB\%..%t
  1376.  
  1377.        The prompt expansion features are also  used  for  another
  1378.        purpose:  if  an environment variable LESSEDIT is defined,
  1379.        it is used as the command to be executed when the  v  com-
  1380.        mand  is  invoked.  The LESSEDIT string is expanded in the
  1381.  
  1382.  
  1383.  
  1384.                                                                21
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390. LESS(1)                                                   LESS(1)
  1391.  
  1392.  
  1393.        same way as the prompt strings.   The  default  value  for
  1394.        LESSEDIT is:
  1395.  
  1396.             %E ?lm+%lm. %f
  1397.  
  1398.        Note that this expands to the editor name, followed by a +
  1399.        and the line number, followed by the file name.   If  your
  1400.        editor  does  not  accept the "+linenumber" syntax, or has
  1401.        other differences in invocation syntax, the LESSEDIT vari-
  1402.        able can be changed to modify this default.
  1403.  
  1404.  
  1405. EENNVVIIRROONNMMEENNTT VVAARRIIAABBLLEESS
  1406.        Environment  variables may be specified either in the sys-
  1407.        tem environment as usual, or in a _l_e_s_s_k_e_y (1) file.
  1408.  
  1409.        COLUMNS
  1410.               Sets the number of columns on  the  screen.   Takes
  1411.               precedence  over the number of columns specified by
  1412.               the TERM variable.  (But if you  have  a  windowing
  1413.               system  which  supports TIOCGWINSZ or WIOCGETD, the
  1414.               window system's  idea  of  the  screen  size  takes
  1415.               precedence  over  the LINES and COLUMNS environment
  1416.               variables.)
  1417.  
  1418.        EDITOR The name of the editor (used for the v command).
  1419.  
  1420.        HOME   Name of the user's home directory (used to  find  a
  1421.               .less file).
  1422.  
  1423.        LANG   Language for determining the character set.
  1424.  
  1425.        LC_CTYPE
  1426.               Language for determining the character set.
  1427.  
  1428.        LESS   Flags which are passed to _l_e_s_s automatically.
  1429.  
  1430.        LESSBINFMT
  1431.               Format  for  displaying  non-printable, non-control
  1432.               characters.
  1433.  
  1434.        LESSCHARDEF
  1435.               Defines a character set.
  1436.  
  1437.        LESSCHARSET
  1438.               Selects a predefined character set.
  1439.  
  1440.        LESSCLOSE
  1441.               Command  line  to  invoke  the  (optional)   input-
  1442.               postprocessor.
  1443.  
  1444.        LESSEDIT
  1445.               Editor  prototype  string (used for the v command).
  1446.               See discussion under PROMPTS.
  1447.  
  1448.  
  1449.  
  1450.                                                                22
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456. LESS(1)                                                   LESS(1)
  1457.  
  1458.  
  1459.        LESSHELP
  1460.               Name of the help file.
  1461.  
  1462.        LESSOPEN
  1463.               Command  line  to  invoke  the  (optional)   input-
  1464.               preprocessor.
  1465.  
  1466.        LINES  Sets  the  number  of  lines  on the screen.  Takes
  1467.               precedence over the number of  lines  specified  by
  1468.               the TERM variable.
  1469.  
  1470.        SHELL  The shell used to execute the ! command, as well as
  1471.               to expand filenames.
  1472.  
  1473.        TERM   The type of terminal on which _l_e_s_s is being run.
  1474.  
  1475.        VISUAL The name of the editor (used for the v command).
  1476.  
  1477.  
  1478. SSEEEE AALLSSOO
  1479.        lesskey(1)
  1480.  
  1481.  
  1482. WWAARRNNIINNGGSS
  1483.        The = command and prompts (unless changed  by  -P)  report
  1484.        the  line number of the line at the top of the screen, but
  1485.        the byte and percent of the line  at  the  bottom  of  the
  1486.        screen.
  1487.  
  1488.        If  the :e command is used to name more than one file, and
  1489.        one of the named files has been viewed previously, the new
  1490.        files may be entered into the list in an unexpected order.
  1491.  
  1492.        On certain older terminals (the so-called  "magic  cookie"
  1493.        terminals),  search  highlighting  will cause an erroneous
  1494.        display.  On such terminals, search highlighting  is  dis-
  1495.        abled by default to avoid possible problems.
  1496.  
  1497.        In  certain cases, when search highlighting is enabled and
  1498.        a search pattern begins with  a  ^,  more  text  than  the
  1499.        matching string may be highlighted.
  1500.  
  1501.  
  1502.  
  1503. CCOOPPYYRRIIGGHHTT
  1504.        Copyright (c) 1984,1985,1989,1994,1995  Mark Nudelman
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.                                                                23
  1517.  
  1518.  
  1519.