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