home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / less-321-src.tgz / tar.out / fsf / less / less.man < prev    next >
Text File  |  1996-09-28  |  59KB  |  1,651 lines

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