home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / utility / less / less.doc next >
Encoding:
Text File  |  1985-11-20  |  12.6 KB  |  293 lines

  1.         
  2.         
  3.         
  4.         
  5.         
  6.         
  7.         LESS - opposite of more
  8.         
  9.         less [-cdepstwmMqQuU] [-hn] [-b[fp]n] [-xn] [+cmd] [name(s)]
  10.         
  11.         LESS is a program similar to  MORE, but  which  allows
  12.         backwards  movement in the file as well as forward movement.
  13.         Also, LESS does not have  to  read  the  entire  input  file
  14.         before starting, so with large input files it starts up fas-
  15.         ter than text editors like vix.
  16.         
  17.              Commands are based on both more and vi.   Commands  may
  18.         be  preceeded  by a decimal number, called N in the descrip-
  19.         tions below.  The number is used by some commands, as  indi-
  20.         cated.
  21.         
  22.         As of this posting, LESS works a) from the desktop and b) in
  23.         the Mark Williams shell.  It  hasn't been tested with the
  24.         Breckmeyer or any other shells.  All references to environment
  25.         variables in the rest of this doc refer to Msh environment
  26.         variables.  Shell escapes and invocations of the editor also
  27.         work only in the Msh.
  28.         
  29.         
  30.         h    Help: display a summary of these commands.  If you for-
  31.              get all the other commands, remember this one.
  32.         
  33.         
  34.         SPACEScroll forward N lines, default one screen.   If  N  is
  35.              more  than  the  screen  size,  only  one  screenful is
  36.              displayed.
  37.         
  38.         
  39.         f    Same as SPACE.
  40.         
  41.         
  42.         b    Scroll backward N lines, default one screen.  If  N  is
  43.              more  than  the  screen  size,  only  one  screenful is
  44.              displayed.
  45.         
  46.         
  47.         RETURNScroll forward N lines, default 1.  If N is more  than
  48.              the screen size, the entire N lines are displayed.
  49.         
  50.         
  51.         e    Same as RETURN.
  52.         
  53.         
  54.         j    Also the same as RETURN.
  55.         
  56.         
  57.         y    Scroll backward N lines, default 1.  If N is more  than
  58.              the screen size, the entire N lines are displayed.
  59.         
  60.         k    Same as y.
  61.         
  62.         
  63.         d    Scroll forward N lines, default 10.  If N is specified,
  64.              it becomes the new default for all d and u commands.
  65.         
  66.         
  67.         u    Scroll backward N lines, default 10.  If  N  is  speci-
  68.              fied,  it  becomes the new default for all d and u com-
  69.              mands.
  70.         
  71.         
  72.         r    Repaint the screen.
  73.         
  74.         
  75.         R    Repaint the  screen,  discarding  any  buffered  input.
  76.              Useful  if  the  file  is  changing  while  it is being
  77.              viewed.
  78.         
  79.         
  80.         g    Go to line N in  the  file,  default  1  (beginning  of
  81.              file).  (Warning: this may be slow if N is large.)
  82.         
  83.         
  84.         G    Go to line N in the file, default the end of the  file.
  85.              (Warning:  this  may  be slow if standard input, rather
  86.              than a file, is being read.)
  87.         
  88.         
  89.         p    Go to a position N percent into the file.  N should  be
  90.              between 0 and 100.  (This is possible if standard input
  91.              is being read, but only if LESS has already read to the
  92.              end  of  the  file.   It is always fast, but not always
  93.              useful.)
  94.         
  95.         
  96.         %    Same as p.
  97.         
  98.         
  99.         m    Followed by any lowercase  letter,  marks  the  current
  100.              position with that letter.
  101.         
  102.         
  103.         '    Followed by any lowercase letter, returns to the  posi-
  104.              tion which was previously marked with that letter.  All
  105.              marks are lost when a new file is examined.
  106.         
  107.         
  108.         /pattern
  109.              Search forward in the file for the  N-th  occurence  of
  110.              the  pattern.  N defaults to 1.  The pattern is a regu-
  111.              lar expression (well, it works most of the time..).  
  112.              The search starts at  the  second  line displayed (but see 
  113.              the -t option, which changes this).
  114.         
  115.         
  116.         ?pattern
  117.              Search backward in the file for the N-th  occurence  of
  118.              the pattern.  The search starts at the line immediately
  119.              before the top line displayed.
  120.         
  121.         
  122.         n    Repeat previous search, for N-th occurence of the  last
  123.              pattern.
  124.         
  125.         
  126.         E    Examine a new file.  If the filename  is  missing,  the
  127.              "current"  file  (see  the N and P commands below) from
  128.              the list of files in the command line is re-examined.
  129.         
  130.         
  131.         N    Examine the next file (from the list of files given  in
  132.              the  command line).  If a number N is specified (not to
  133.              be confused with the command N), the N-th next file  is
  134.              examined.
  135.         
  136.         
  137.         P    Examine the previous file.  If a number N is specified,
  138.              the N-th previous file is examined.
  139.         
  140.         
  141.         =    Prints the name of the file being viewed and  the  byte
  142.              offset  of  the bottom line being displayed.  If possi-
  143.              ble, it also prints the length of the file and the per-
  144.              cent of the file above the last displayed line.
  145.         
  146.         
  147.         -    Followed by one of the command line option letters (see
  148.              below), this will toggle the setting of that option and
  149.              print a message describing the new setting.
  150.         
  151.         
  152.         V    Prints the version number of LESS being run.
  153.         
  154.         
  155.         q    Exits LESS.
  156.         
  157.              The following two commands at present work only with
  158.         the 'msh' of  Mark Willaims C (when LESS is run from  the
  159.         desktop, a  'Shell not found'  message is printed out.  A
  160.         fix for non-shell environments is in the offing).
  161.         
  162.         
  163.         v    Invokes an  editor  to  edit  the  current  file  being
  164.              viewed.  The editor is taken from the environment vari-
  165.              able EDITOR, or defaults to "vi".
  166.         
  167.         
  168.         ! shell-command
  169.              Invokes a shell to run the shell-command given.
  170.         
  171.         
  172.         Command line options are described below.  Options are  also
  173.         taken  from  the environment variable "LESS".  (The environ-
  174.         ment variable is parsed before the command line, so  command
  175.         line   options   override  the  LESS  environment  variable.
  176.         Options may be changed while LESS is  running  via  the  "-"
  177.         command.)  For example, if you like more-style prompting, to
  178.         avoid typing "less -pm ..." each time LESS  is  invoked,  you
  179.         might tell Msh (the Mark Williams shell):
  180.         
  181.         setenv LESS=-pm
  182.         
  183.         -s   The -s  flag  causes  consecutive  blank  lines  to  be
  184.              squeezed into a single blank line.  This is useful when
  185.              viewing nroff output.
  186.         
  187.         -t   Normally, forward searches start  just  after  the  top
  188.              displayed line (that is, at the second displayed line).
  189.              Thus forward searches include the  currently  displayed
  190.              screen.   The  -t  command  line  option causes forward
  191.              searches to start just after the bottom line displayed,
  192.              thus skipping the currently displayed screen.
  193.         
  194.         -m   The  -m  command line  option causes LESS to prompt 
  195.              less verbosely like more, printing the file name and 
  196.              percent into the file, or just with a colon.
  197.         
  198.         -M   The -M command line option causes LESS to  prompt  even
  199.              more verbosely than more (this is the default).
  200.         
  201.         -q   Normally, if an attempt is made to scroll past the  end
  202.              of  the  file  or before the beginning of the file, the
  203.              terminal bell is rung to indicate this  fact.   The  -q
  204.              command  line option tells LESS not to ring the bell at
  205.              such times.  If the terminal has a "visual bell", it is
  206.              used instead.
  207.         
  208.         -Q   Even if -q is given, LESS will ring the bell on certain
  209.              other errors, such as typing an invalid character.  The
  210.              -Q command line option tells LESS to be quiet  all  the
  211.              time.
  212.         
  213.         -e   Normally the only way to exit LESS is via the "q"  com-
  214.              mand.   The  -e  command  line  option  tells  LESS  to
  215.              automatically exit the second time it  reaches  end-of-
  216.              file.
  217.         
  218.         -u   If the -u command line option is given, backspaces  are
  219.              treated as printable characters; that is, they are sent
  220.              to the terminal when they appear in the input.
  221.         
  222.         -U   If the -U command line option is given, backspaces  are
  223.              printed as the two character sequence "^H".  If neither
  224.              -u nor -U is given, backspaces which appear adjacent to
  225.              an  underscore  character  are  treated  specially: the
  226.              underlined  text  is  displayed  using  the  terminal's
  227.              hardware underlining capability.
  228.         
  229.         -w   Normally, LESS uses  a  tilde  character  to  represent
  230.              lines  past  the end of the file.  The -w option causes
  231.              blank lines to be used instead.
  232.         
  233.         -p   Normally, LESS will repaint  the  screen  by  scrolling
  234.              from  the bottom of the screen.  If the -p flag is set,
  235.              when LESS needs to change the entire display,  it  will
  236.              clear the screen and paint from the top line down.
  237.         
  238.         -h   Normally, LESS will  scroll  backwards  when  backwards
  239.              movement  is necessary.  The -h option specifies a max-
  240.              imum number of lines to scroll  backwards.   If  it  is
  241.              necessary  to move backwards more than this many lines,
  242.              the screen is repainted in a  forward  direction.
  243.         
  244.         -x   The -xn command line option  sets  tab  stops  every  n
  245.              positions.  The default for n is 8.
  246.         
  247.         -b   The -bn command line option tells LESS to  use  a  non-
  248.              standard buffer size.  There are two standard (default)
  249.              buffer sizes, one is used when a file is being read and
  250.              the  other  when a pipe (standard input) is being read.
  251.              The current defaults are 5 buffers for files and 12 for
  252.              pipes.   (Buffers  are 1024 bytes.) The number n speci-
  253.              fies a different number of buffers to use.  The -b  may
  254.              be followed by "f", in which case only the file default
  255.              is changed, or by "p"  in  which  case  only  the  pipe
  256.              default is changed.  Otherwise, both are changed.
  257.         
  258.         -c   Normally, when data is read by LESS, it is  scanned  to
  259.              ensure that bit 7 (the high order bit) is turned off in
  260.              each byte read, and to ensure that there  are  no  null
  261.              (zero)  bytes  in  the data (null bytes are turned into
  262.              "@" characters).  If the data is known to  be  "clean",
  263.              the  -c command line option will tell LESS to skip this
  264.              checking, causing an imperceptible  speed  improvement.
  265.              (However,  if  the  data is not "clean", unpredicatable
  266.              results may occur.)
  267.         
  268.         +    If a command line option begins with +,  the  remainder
  269.              of  that  option  is  taken to be an initial command to
  270.              LESS.  For example, +G tells LESS to start at  the  end
  271.              of  the file rather than the beginning, and +/xyz tells
  272.              it to start at the first  occurence  of  "xyz"  in  the
  273.              file.    As   a   special  case,  +<number>  acts  like
  274.              +<number>g; that is,  it  starts  the  display  at  the
  275.              specified  line  number  (however, see the caveat under
  276.              the "g" command above).  If the option starts with  ++,
  277.              the initial command applies to every file being viewed,
  278.              not just the first one.
  279.         
  280.         
  281.         When used on standard input (rather than a  file),  you  can
  282.         move  backwards  only a finite amount, corresponding to that
  283.         portion of the file which is still buffered.
  284.         
  285.  
  286.     Bugs:    The program has problems when it is fed input
  287.     as standard input, say from a pipe.  eg. the following
  288.         line (in Msh) will eventually cause something to bomb:
  289.  
  290.         $ cat foo | less
  291.  
  292.  
  293. əəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəə