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