home *** CD-ROM | disk | FTP | other *** search
-
-
-
- LLLLEEEESSSSSSSS((((llll)))) LLLLEEEESSSSSSSS((((llll))))
-
-
-
-
- NNNNAAAAMMMMEEEE
- less - opposite of more
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- lllleeeessssssss [[[[----BBBBccccddddeeeeppppssssttttvvvvwwwwmmmmMMMMqqqqQQQQuuuuUUUU]]]] [[[[----hhhh_N]]]] [[[[----bbbb[[[[ffffpppp]]]]_N]]]] [[[[----xxxx_N]]]] [[[[----[[[[zzzz]]]]_N]]]]
- [[[[----PPPP[[[[mmmmMMMM]]]]_s_t_r_i_n_g]]]] [[[[----llll_l_o_g_f_i_l_e]]]] [[[[++++_c_m_d]]]] [[[[_f_i_l_e_n_a_m_e]]]]............
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- _L_e_s_s is a program similar to _m_o_r_e (1), but which allows
- backwards movement in the file as well as forward movement.
- Also, _l_e_s_s does not have to read the entire input file
- before starting, so with large input files it starts up
- faster than text editors like _v_i (1). _L_e_s_s uses termcap, so
- it can run on a variety of terminals. There is even limited
- support for hardcopy terminals. (On a hardcopy terminal,
- lines which should be printed at the top of the screen are
- prefixed with an up-arrow.)
-
- Commands are based on both _m_o_r_e and _v_i. Commands may be
- preceeded by a decimal number, called N in the descriptions
- below. The number is used by some commands, as indicated.
-
-
- CCCCOOOOMMMMMMMMAAAANNNNDDDDSSSS
- In the following descriptions, ^X means control-X.
-
- h Help: display a summary of these commands. If you
- forget all the other commands, remember this one. If
- the help file is not ./less.hlp, then you should set
- the environment variable LESSHELP to the full pathname
- of the actual help file.
-
- SPACE
- Scroll forward N lines, default one window (see option
- -z below). If N is more than the screen size, only the
- final screenful is displayed.
-
- f or ^F
- Same as SPACE.
-
- b or ^B
- Scroll backward N lines, default one window (see option
- -z below). If N is more than the screen size, only the
- final screenful is displayed.
-
- RETURN
- Scroll forward N lines, default 1. The entire N lines
- are displayed, even if N is more than the screen size.
-
- e or ^E
- Same as RETURN.
-
-
-
- Hewlett-Packard Company - 1 - Feb 20, 1991
-
-
-
-
-
-
- LLLLEEEESSSSSSSS((((llll)))) LLLLEEEESSSSSSSS((((llll))))
-
-
-
-
- j or ^J
- Also the same as RETURN.
-
- y or ^Y
- Scroll backward N lines, default 1. The entire N lines
- are displayed, even if N is more than the screen size.
-
- k or ^K
- Same as y.
-
- d or ^D
- Scroll forward N lines, default 10. If N is specified,
- it becomes the new default for subsequent d and u
- commands.
-
- u or ^U
- Scroll backward N lines, default 10. If N is
- specified, it becomes the new default for subsequent d
- and u commands.
-
- r or ^R or ^L
- Repaint the screen.
-
- R Repaint the screen, discarding any buffered input.
- Useful if the file is changing while it is being
- viewed.
-
- g Go to line N in the file, default 1 (beginning of
- file). (Warning: this may be slow if N is large.)
-
- G Go to line N in the file, default the end of the file.
- (Warning: this may be slow if standard input, rather
- than a file, is being read.)
-
- p Go to a position N percent into the file. N should be
- between 0 and 100. (This is possible if standard input
- is being read, but only if _l_e_s_s has already read to the
- end of the file. It is always fast, but not always
- useful.)
-
- % Same as p.
-
- m Followed by any lowercase letter, marks the current
- position with that letter.
-
- ' (Single quote.) Followed by any lowercase letter,
- returns to the position which was previously marked
- with that letter. Followed by another single quote,
- returns to the postion at which the last "large"
- movement command was executed. All marks are lost when
- a new file is examined.
-
-
-
- Hewlett-Packard Company - 2 - Feb 20, 1991
-
-
-
-
-
-
- LLLLEEEESSSSSSSS((((llll)))) LLLLEEEESSSSSSSS((((llll))))
-
-
-
-
- /pattern
- Search forward in the file for the N-th line containing
- the pattern. N defaults to 1. The pattern is a
- regular expression, as recognized by _e_d. The search
- starts at the second line displayed (but see the -t
- option, which changes this).
-
- ?pattern
- Search backward in the file for the N-th line
- containing the pattern. The search starts at the line
- immediately before the top line displayed.
-
- n Repeat previous search, for N-th line containing the
- last pattern.
-
- E Examine a new file. If the filename is missing, the
- "current" file (see the N and P commands below) from
- the list of files in the command line is re-examined.
-
- N Examine the next file (from the list of files given in
- the command line). If a number N is specified (not to
- be confused with the command N), the N-th next file is
- examined.
-
- P Examine the previous file. If a number N is specified,
- the N-th previous file is examined.
-
- = or ^G
- Prints some information about the file being viewed,
- including its name and the byte offset of the bottom
- line being displayed. If possible, it also prints the
- length of the file and the percent of the file above
- the last displayed line.
-
- - Followed by one of the command line option letters (see
- below), this will toggle the setting of that option and
- print a message describing the new setting.
-
- +cmd Causes the specified cmd to be executed each time a new
- file is examined. For example, +G causes _l_e_s_s to
- initially display each file starting at the end rather
- than the beginning.
-
- V Prints the version number of _l_e_s_s being run.
-
- q Exits _l_e_s_s.
-
- The following two commands may or may not be valid,
- depending on your particular installation.
-
- v Invokes an editor to edit the current file being
-
-
-
- Hewlett-Packard Company - 3 - Feb 20, 1991
-
-
-
-
-
-
- LLLLEEEESSSSSSSS((((llll)))) LLLLEEEESSSSSSSS((((llll))))
-
-
-
-
- viewed. The editor is taken from the environment
- variable _E_D_I_T_O_R or defaults to _v_i
-
- ! shell-command
- Invokes a shell to run the shell-command given.
-
- OOOOPPPPTTTTIIIIOOOONNNNSSSS
- Command line options are described below. Most options may
- be changed while _l_e_s_s is running, via the "-" command.
-
- Options are also taken from the environment variable "LESS".
- For example, if you like _m_o_r_e -style prompting, to avoid
- typing "less -m ..." each time _l_e_s_s is invoked, you might
- tell _c_s_h:
-
- setenv LESS m
-
- or if you use _s_h:
-
- LESS=m; export LESS
-
- The environment variable is parsed before the command line,
- so command line options override the LESS environment
- variable. A dollar sign ($) may be used to signal the end
- of an option string. This is important only for options
- like -P which take a following string.
-
- -s The -s option causes consecutive blank lines to be
- squeezed into a single blank line. This is useful when
- viewing _n_r_o_f_f output.
-
- -t Normally, forward searches start just after the top
- displayed line (that is, at the second displayed line).
- Thus forward searches include the currently displayed
- screen. The -t option causes forward searches to start
- just after the bottom line displayed, thus skipping the
- currently displayed screen.
-
- -m Normally, _l_e_s_s prompts with a colon. The -m option
- causes _l_e_s_s to prompt verbosely (like _m_o_r_e), with the
- percent into the file.
-
- -M The -M option causes _l_e_s_s to prompt even more verbosely
- than _m_o_r_e.
-
- -P The -P option provides a way to tailor the three prompt
- styles to your own preference. You would normally put
- this option in your LESS environment variable, rather
- than type it in with each _l_e_s_s command. Such an option
- must either be the last option in the LESS variable, or
- be terminated by a dollar sign. -P followed by a
-
-
-
- Hewlett-Packard Company - 4 - Feb 20, 1991
-
-
-
-
-
-
- LLLLEEEESSSSSSSS((((llll)))) LLLLEEEESSSSSSSS((((llll))))
-
-
-
-
- string changes the default (short) prompt to that
- string. -Pm changes the medium (-m) prompt to the
- string, and -PM changes the long (-M) prompt. The
- string consists of a sequence of letters which are
- replaced with certain predefined strings, as follows:
- F file name
- f file name, only once
- O file n of n
- o file n of n, only once
- b byte offset
- p percent into file
- P percent if known, else byte offset
- Angle brackets, < and >, may be used to surround a
- literal string to be included in the prompt. The
- defaults are "fo" for the short prompt, "foP" for the
- medium prompt, and "Fobp" for the long prompt.
- Example: Setting your LESS variable to "PmFOP$PMFObp"
- would change the medium and long prompts to always
- include the file name and "file n of n" message.
- Another example: Setting your LESS variable to
- "mPm<--Less-->FoPe" would change the medium prompt to
- the string "--Less--" followed by the file name and
- percent into the file. It also selects the medium
- prompt as the default prompt (because of the first
- "m").
-
- -q Normally, if an attempt is made to scroll past the end
- of the file or before the beginning of the file, the
- terminal bell is rung to indicate this fact. The -q
- option tells _l_e_s_s not to ring the bell at such times.
- If the terminal has a "visual bell", it is used
- instead.
-
- -Q Even if -q is given, _l_e_s_s will ring the bell on certain
- other errors, such as typing an invalid character. The
- -Q option tells _l_e_s_s to be quiet all the time; that is,
- never ring the terminal bell. If the terminal has a
- "visual bell", it is used instead.
-
- -e Normally the only way to exit _l_e_s_s is via the "q"
- command. The -e option tells _l_e_s_s to automatically
- exit the second time it reaches end-of-file.
-
- -u If the -u option is given, backspaces are treated as
- printable characters; that is, they are sent to the
- terminal when they appear in the input.
-
- -U If the -U option is given, backspaces are printed as
- the two character sequence "^H".
-
- If neither -u nor -U is given, backspaces which appear
-
-
-
- Hewlett-Packard Company - 5 - Feb 20, 1991
-
-
-
-
-
-
- LLLLEEEESSSSSSSS((((llll)))) LLLLEEEESSSSSSSS((((llll))))
-
-
-
-
- adjacent to an underscore character are treated
- specially: the underlined text is displayed using the
- terminal's hardware underlining capability. Also,
- backspaces which appear between two identical
- characters are treated specially: the overstruck text
- is printed using the terminal's hardware boldface
- capability. Other backspaces are deleted, along with
- the preceeding character.
-
- -B Normally, this (specially modified) version of _l_e_s_s
- ignores backspace sequences during string searches.
- That is, all occurrences of a character followed by a
- backspace are stripped out from the text to prevent
- redundant sequences from interfering with text
- searches. This behaviour is different from "standard"
- _l_e_s_s, and allows one to search for keywords in _m_a_n
- pages or other _n_r_o_f_f output. The -B option is used to
- disable this feature, for "compatibility" with standard
- _l_e_s_s.
-
- -v When invoking _v_i using the "v" command, it is sometimes
- convenient to have _v_i start up at the same part of the
- file that was being viewed with _l_e_s_s immediately
- beforehand. This option enables this feature, by
- causing a '+n' sequence to be inserted between _E_D_I_T_O_R
- and the file name, where 'n' is the current line in the
- file (at top of screen in _l_e_s_s ).
-
- -w Normally, _l_e_s_s uses a tilde character to represent
- lines past the end of the file. The -w option causes
- blank lines to be used instead.
-
- -d Normally, _l_e_s_s will complain if the terminal is dumb;
- that is, lacks some important capability, such as the
- ability to clear the screen or scroll backwards. The
- -d option suppresses this complaint (but does not
- otherwise change the behavior of the program on a dumb
- terminal).
-
- -p Normally, _l_e_s_s will repaint the screen by scrolling
- from the bottom of the screen. If the -p option is
- set, when _l_e_s_s needs to change the entire display, it
- will clear the screen and paint from the top line down.
-
- -h Normally, _l_e_s_s will scroll backwards when backwards
- movement is necessary. The -h option specifies a
- maximum number of lines to scroll backwards. If it is
- necessary to move backwards more than this many lines,
- the screen is repainted in a forward direction. (If
- the terminal does not have the ability to scroll
- backwards, -h0 is implied.)
-
-
-
- Hewlett-Packard Company - 6 - Feb 20, 1991
-
-
-
-
-
-
- LLLLEEEESSSSSSSS((((llll)))) LLLLEEEESSSSSSSS((((llll))))
-
-
-
-
- -[z] When given a backwards or forwards window command, _l_e_s_s
- will by default scroll backwards or forwards one
- screenful of lines. The -z_n option changes the default
- scrolling window size to _n lines. If _n is greater than
- the screen size, the scrolling window size will be set
- to one screenful. Note that the "z" is optional for
- compatibility with _m_o_r_e.
-
- -x The -x_n option sets tab stops every _n positions. The
- default for _n is 8.
-
- -l The -l option, followed immediately by a filename, will
- cause _l_e_s_s to copy its input to the named file as it is
- being viewed. This applies only when the input file is
- a pipe, not an ordinary file.
-
- -b The -b_n option tells _l_e_s_s to use a non-standard buffer
- size. There are two standard (default) buffer sizes,
- one is used when a file is being read and the other
- when a pipe (standard input) is being read. The
- current defaults are 5 buffers for files and 12 for
- pipes. (Buffers are 1024 bytes.) The number _n
- specifies a different number of buffers to use. The -b
- may be followed by "f", in which case only the file
- default is changed, or by "p" in which case only the
- pipe default is changed. Otherwise, both are changed.
-
- -c Normally, when data is read by _l_e_s_s, it is scanned to
- ensure that bit 7 (the high order bit) is turned off in
- each byte read, and to ensure that there are no null
- (zero) bytes in the data (null bytes are turned into
- "@" characters). If the data is known to be "clean",
- the -c option will tell _l_e_s_s to skip this checking,
- causing an imperceptible speed improvement. (However,
- if the data is not "clean", unpredicatable results may
- occur.)
-
- + If a command line option begins with ++++, the remainder
- of that option is taken to be an initial command to
- _l_e_s_s. For example, +G tells _l_e_s_s to start at the end of
- the file rather than the beginning, and +/xyz tells it
- to start at the first occurence of "xyz" in the file.
- As a special case, +<number> acts like +<number>g; that
- is, it starts the display at the specified line number
- (however, see the caveat under the "g" command above).
- If the option starts with ++++++++, the initial command
- applies to every file being viewed, not just the first
- one. The + command described previously may also be
- used to set (or change) an initial command for every
- file.
-
-
-
-
- Hewlett-Packard Company - 7 - Feb 20, 1991
-
-
-
-
-
-
- LLLLEEEESSSSSSSS((((llll)))) LLLLEEEESSSSSSSS((((llll))))
-
-
-
-
- BBBBUUUUGGGGSSSS
- When used on standard input (rather than a file), you can
- move backwards only a finite amount, corresponding to that
- portion of the file which is still buffered. The -b option
- may be used to expand the buffer space.
-
- The environment variable _L_E_S_S_H_E_L_P must be defined to supply
- the full path for the help file (less.hlp) in order for the
- help function to work.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Hewlett-Packard Company - 8 - Feb 20, 1991
-
-
-
-