home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / CMDS / less_330.lzh / DOC / less.nro < prev    next >
Text File  |  1996-10-31  |  48KB  |  1,339 lines

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