less.man revision 60786
160786Sps 260786Sps 360786Sps 460786SpsLESS(1) LESS(1) 560786Sps 660786Sps 760786SpsNNAAMMEE 860786Sps less - opposite of more 960786Sps 1060786SpsSSYYNNOOPPSSIISS 1160786Sps lleessss --?? 1260786Sps lleessss ----hheellpp 1360786Sps lleessss --VV 1460786Sps lleessss ----vveerrssiioonn 1560786Sps lleessss [[--[[++]]aaBBccCCddeeEEffggGGiiIImmMMnnNNqqQQrrssSSuuUUVVwwXX]] 1660786Sps [[--bb _b_u_f_s]] [[--hh _l_i_n_e_s]] [[--jj _l_i_n_e]] [[--kk _k_e_y_f_i_l_e]] 1760786Sps [[--{{ooOO}} _l_o_g_f_i_l_e]] [[--pp _p_a_t_t_e_r_n]] [[--PP _p_r_o_m_p_t]] [[--tt _t_a_g]] 1860786Sps [[--TT _t_a_g_s_f_i_l_e]] [[--xx _t_a_b]] [[--yy _l_i_n_e_s]] [[--[[zz]] _l_i_n_e_s]] 1960786Sps [[++[[++]]_c_m_d]] [[----]] [[_f_i_l_e_n_a_m_e]]...... 2060786Sps (See the OPTIONS section for alternate option syntax with 2160786Sps long option names.) 2260786Sps 2360786Sps 2460786SpsDDEESSCCRRIIPPTTIIOONN 2560786Sps _L_e_s_s is a program similar to _m_o_r_e (1), but which allows 2660786Sps backward movement in the file as well as forward movement. 2760786Sps Also, _l_e_s_s does not have to read the entire input file 2860786Sps before starting, so with large input files it starts up 2960786Sps faster than text editors like _v_i (1). _L_e_s_s uses termcap 3060786Sps (or terminfo on some systems), so it can run on a variety 3160786Sps of terminals. There is even limited support for hardcopy 3260786Sps terminals. (On a hardcopy terminal, lines which should be 3360786Sps printed at the top of the screen are prefixed with a 3460786Sps caret.) 3560786Sps 3660786Sps Commands are based on both _m_o_r_e and _v_i_. Commands may be 3760786Sps preceded by a decimal number, called N in the descriptions 3860786Sps below. The number is used by some commands, as indicated. 3960786Sps 4060786Sps 4160786SpsCCOOMMMMAANNDDSS 4260786Sps In the following descriptions, ^X means control-X. ESC 4360786Sps stands for the ESCAPE key; for example ESC-v means the two 4460786Sps character sequence "ESCAPE", then "v". 4560786Sps 4660786Sps h or H Help: display a summary of these commands. If you 4760786Sps forget all the other commands, remember this one. 4860786Sps 4960786Sps SPACE or ^V or f or ^F 5060786Sps Scroll forward N lines, default one window (see 5160786Sps option -z below). If N is more than the screen 5260786Sps size, only the final screenful is displayed. Warn- 5360786Sps ing: some systems use ^V as a special literaliza- 5460786Sps tion character. 5560786Sps 5660786Sps z Like SPACE, but if N is specified, it becomes the 5760786Sps new window size. 5860786Sps 5960786Sps ESC-SPACE 6060786Sps Like SPACE, but scrolls a full screenful, even if 6160786Sps 6260786Sps 6360786Sps 6460786Sps Version 354: 23 Mar 2000 1 6560786Sps 6660786Sps 6760786Sps 6860786Sps 6960786Sps 7060786SpsLESS(1) LESS(1) 7160786Sps 7260786Sps 7360786Sps it reaches end-of-file in the process. 7460786Sps 7560786Sps RETURN or ^N or e or ^E or j or ^J 7660786Sps Scroll forward N lines, default 1. The entire N 7760786Sps lines are displayed, even if N is more than the 7860786Sps screen size. 7960786Sps 8060786Sps d or ^D 8160786Sps Scroll forward N lines, default one half of the 8260786Sps screen size. If N is specified, it becomes the new 8360786Sps default for subsequent d and u commands. 8460786Sps 8560786Sps b or ^B or ESC-v 8660786Sps Scroll backward N lines, default one window (see 8760786Sps option -z below). If N is more than the screen 8860786Sps size, only the final screenful is displayed. 8960786Sps 9060786Sps w Like ESC-v, but if N is specified, it becomes the 9160786Sps new window size. 9260786Sps 9360786Sps y or ^Y or ^P or k or ^K 9460786Sps Scroll backward N lines, default 1. The entire N 9560786Sps lines are displayed, even if N is more than the 9660786Sps screen size. Warning: some systems use ^Y as a 9760786Sps special job control character. 9860786Sps 9960786Sps u or ^U 10060786Sps Scroll backward N lines, default one half of the 10160786Sps screen size. If N is specified, it becomes the new 10260786Sps default for subsequent d and u commands. 10360786Sps 10460786Sps ESC-) or RIGHTARROW 10560786Sps Scroll horizontally right N characters, default 8. 10660786Sps This behaves best if you also set the -S option 10760786Sps (chop lines). Note that if you wish to enter a 10860786Sps number N, you must use ESC-), not RIGHTARROW, 10960786Sps because the arrow is taken to be a line editing 11060786Sps command (see the LINE EDITING section). 11160786Sps 11260786Sps ESC-( or LEFTARROW 11360786Sps Scroll horizontally left N characters, default 8. 11460786Sps 11560786Sps r or ^R or ^L 11660786Sps Repaint the screen. 11760786Sps 11860786Sps R Repaint the screen, discarding any buffered input. 11960786Sps Useful if the file is changing while it is being 12060786Sps viewed. 12160786Sps 12260786Sps F Scroll forward, and keep trying to read when the 12360786Sps end of file is reached. Normally this command 12460786Sps would be used when already at the end of the file. 12560786Sps It is a way to monitor the tail of a file which is 12660786Sps growing while it is being viewed. (The behavior is 12760786Sps 12860786Sps 12960786Sps 13060786Sps Version 354: 23 Mar 2000 2 13160786Sps 13260786Sps 13360786Sps 13460786Sps 13560786Sps 13660786SpsLESS(1) LESS(1) 13760786Sps 13860786Sps 13960786Sps similar to the "tail -f" command.) 14060786Sps 14160786Sps g or < or ESC-< 14260786Sps Go to line N in the file, default 1 (beginning of 14360786Sps file). (Warning: this may be slow if N is large.) 14460786Sps 14560786Sps G or > or ESC-> 14660786Sps Go to line N in the file, default the end of the 14760786Sps file. (Warning: this may be slow if N is large, or 14860786Sps if N is not specified and standard input, rather 14960786Sps than a file, is being read.) 15060786Sps 15160786Sps p or % Go to a position N percent into the file. N should 15260786Sps be between 0 and 100. 15360786Sps 15460786Sps { If a left curly bracket appears in the top line 15560786Sps displayed on the screen, the { command will go to 15660786Sps the matching right curly bracket. The matching 15760786Sps right curly bracket is positioned on the bottom 15860786Sps line of the screen. If there is more than one left 15960786Sps curly bracket on the top line, a number N may be 16060786Sps used to specify the N-th bracket on the line. 16160786Sps 16260786Sps } If a right curly bracket appears in the bottom line 16360786Sps displayed on the screen, the } command will go to 16460786Sps the matching left curly bracket. The matching left 16560786Sps curly bracket is positioned on the top line of the 16660786Sps screen. If there is more than one right curly 16760786Sps bracket on the top line, a number N may be used to 16860786Sps specify the N-th bracket on the line. 16960786Sps 17060786Sps ( Like {, but applies to parentheses rather than 17160786Sps curly brackets. 17260786Sps 17360786Sps ) Like }, but applies to parentheses rather than 17460786Sps curly brackets. 17560786Sps 17660786Sps [ Like {, but applies to square brackets rather than 17760786Sps curly brackets. 17860786Sps 17960786Sps ] Like }, but applies to square brackets rather than 18060786Sps curly brackets. 18160786Sps 18260786Sps ESC-^F Followed by two characters, acts like {, but uses 18360786Sps the two characters as open and close brackets, 18460786Sps respectively. For example, "ESC ^F < >" could be 18560786Sps used to go forward to the > which matches the < in 18660786Sps the top displayed line. 18760786Sps 18860786Sps ESC-^B Followed by two characters, acts like }, but uses 18960786Sps the two characters as open and close brackets, 19060786Sps respectively. For example, "ESC ^B < >" could be 19160786Sps used to go backward to the < which matches the > in 19260786Sps the bottom displayed line. 19360786Sps 19460786Sps 19560786Sps 19660786Sps Version 354: 23 Mar 2000 3 19760786Sps 19860786Sps 19960786Sps 20060786Sps 20160786Sps 20260786SpsLESS(1) LESS(1) 20360786Sps 20460786Sps 20560786Sps m Followed by any lowercase letter, marks the current 20660786Sps position with that letter. 20760786Sps 20860786Sps ' (Single quote.) Followed by any lowercase letter, 20960786Sps returns to the position which was previously marked 21060786Sps with that letter. Followed by another single 21160786Sps quote, returns to the position at which the last 21260786Sps "large" movement command was executed. Followed by 21360786Sps a ^ or $, jumps to the beginning or end of the file 21460786Sps respectively. Marks are preserved when a new file 21560786Sps is examined, so the ' command can be used to switch 21660786Sps between input files. 21760786Sps 21860786Sps ^X^X Same as single quote. 21960786Sps 22060786Sps /pattern 22160786Sps Search forward in the file for the N-th line con- 22260786Sps taining the pattern. N defaults to 1. The pattern 22360786Sps is a regular expression, as recognized by _e_d_. The 22460786Sps search starts at the second line displayed (but see 22560786Sps the -a and -j options, which change this). 22660786Sps 22760786Sps Certain characters are special if entered at the 22860786Sps beginning of the pattern; they modify the type of 22960786Sps search rather than become part of the pattern: 23060786Sps 23160786Sps ^N or ! 23260786Sps Search for lines which do NOT match the pat- 23360786Sps tern. 23460786Sps 23560786Sps ^E or * 23660786Sps Search multiple files. That is, if the 23760786Sps search reaches the END of the current file 23860786Sps without finding a match, the search contin- 23960786Sps ues in the next file in the command line 24060786Sps list. 24160786Sps 24260786Sps ^F or @ 24360786Sps Begin the search at the first line of the 24460786Sps FIRST file in the command line list, regard- 24560786Sps less of what is currently displayed on the 24660786Sps screen or the settings of the -a or -j 24760786Sps options. 24860786Sps 24960786Sps ^K Highlight any text which matches the pattern 25060786Sps on the current screen, but don't move to the 25160786Sps first match (KEEP current position). 25260786Sps 25360786Sps ^R Don't interpret regular expression metachar- 25460786Sps acters; that is, do a simple textual compar- 25560786Sps ison. 25660786Sps 25760786Sps ?pattern 25860786Sps Search backward in the file for the N-th line 25960786Sps 26060786Sps 26160786Sps 26260786Sps Version 354: 23 Mar 2000 4 26360786Sps 26460786Sps 26560786Sps 26660786Sps 26760786Sps 26860786SpsLESS(1) LESS(1) 26960786Sps 27060786Sps 27160786Sps containing the pattern. The search starts at the 27260786Sps line immediately before the top line displayed. 27360786Sps 27460786Sps Certain characters are special as in the / command: 27560786Sps 27660786Sps ^N or ! 27760786Sps Search for lines which do NOT match the pat- 27860786Sps tern. 27960786Sps 28060786Sps ^E or * 28160786Sps Search multiple files. That is, if the 28260786Sps search reaches the beginning of the current 28360786Sps file without finding a match, the search 28460786Sps continues in the previous file in the com- 28560786Sps mand line list. 28660786Sps 28760786Sps ^F or @ 28860786Sps Begin the search at the last line of the 28960786Sps last file in the command line list, regard- 29060786Sps less of what is currently displayed on the 29160786Sps screen or the settings of the -a or -j 29260786Sps options. 29360786Sps 29460786Sps ^K As in forward searches. 29560786Sps 29660786Sps ^R As in forward searches. 29760786Sps 29860786Sps ESC-/pattern 29960786Sps Same as "/*". 30060786Sps 30160786Sps ESC-?pattern 30260786Sps Same as "?*". 30360786Sps 30460786Sps n Repeat previous search, for N-th line containing 30560786Sps the last pattern. If the previous search was modi- 30660786Sps fied by ^N, the search is made for the N-th line 30760786Sps NOT containing the pattern. If the previous search 30860786Sps was modified by ^E, the search continues in the 30960786Sps next (or previous) file if not satisfied in the 31060786Sps current file. If the previous search was modified 31160786Sps by ^R, the search is done without using regular 31260786Sps expressions. There is no effect if the previous 31360786Sps search was modified by ^F or ^K. 31460786Sps 31560786Sps N Repeat previous search, but in the reverse direc- 31660786Sps tion. 31760786Sps 31860786Sps ESC-n Repeat previous search, but crossing file bound- 31960786Sps aries. The effect is as if the previous search 32060786Sps were modified by *. 32160786Sps 32260786Sps ESC-N Repeat previous search, but in the reverse direc- 32360786Sps tion and crossing file boundaries. 32460786Sps 32560786Sps 32660786Sps 32760786Sps 32860786Sps Version 354: 23 Mar 2000 5 32960786Sps 33060786Sps 33160786Sps 33260786Sps 33360786Sps 33460786SpsLESS(1) LESS(1) 33560786Sps 33660786Sps 33760786Sps ESC-u Undo search highlighting. Turn off highlighting of 33860786Sps strings matching the current search pattern. If 33960786Sps highlighting is already off because of a previous 34060786Sps ESC-u command, turn highlighting back on. Any 34160786Sps search command will also turn highlighting back on. 34260786Sps (Highlighting can also be disabled by toggling the 34360786Sps -G option; in that case search commands do not turn 34460786Sps highlighting back on.) 34560786Sps 34660786Sps :e [filename] 34760786Sps Examine a new file. If the filename is missing, 34860786Sps the "current" file (see the :n and :p commands 34960786Sps below) from the list of files in the command line 35060786Sps is re-examined. A percent sign (%) in the filename 35160786Sps is replaced by the name of the current file. A 35260786Sps pound sign (#) is replaced by the name of the pre- 35360786Sps viously examined file. However, two consecutive 35460786Sps percent signs are simply replaced with a single 35560786Sps percent sign. This allows you to enter a filename 35660786Sps that contains a percent sign in the name. Simi- 35760786Sps larly, two consecutive pound signs are replaced 35860786Sps with a single pound sign. The filename is inserted 35960786Sps into the command line list of files so that it can 36060786Sps be seen by subsequent :n and :p commands. If the 36160786Sps filename consists of several files, they are all 36260786Sps inserted into the list of files and the first one 36360786Sps is examined. If the filename contains one or more 36460786Sps spaces, the entire filename should be enclosed in 36560786Sps double quotes (also see the -" option). 36660786Sps 36760786Sps ^X^V or E 36860786Sps Same as :e. Warning: some systems use ^V as a spe- 36960786Sps cial literalization character. On such systems, 37060786Sps you may not be able to use ^V. 37160786Sps 37260786Sps :n Examine the next file (from the list of files given 37360786Sps in the command line). If a number N is specified, 37460786Sps the N-th next file is examined. 37560786Sps 37660786Sps :p Examine the previous file in the command line list. 37760786Sps If a number N is specified, the N-th previous file 37860786Sps is examined. 37960786Sps 38060786Sps :x Examine the first file in the command line list. 38160786Sps If a number N is specified, the N-th file in the 38260786Sps list is examined. 38360786Sps 38460786Sps :d Remove the current file from the list of files. 38560786Sps 38660786Sps = or ^G or :f 38760786Sps Prints some information about the file being 38860786Sps viewed, including its name and the line number and 38960786Sps byte offset of the bottom line being displayed. If 39060786Sps possible, it also prints the length of the file, 39160786Sps 39260786Sps 39360786Sps 39460786Sps Version 354: 23 Mar 2000 6 39560786Sps 39660786Sps 39760786Sps 39860786Sps 39960786Sps 40060786SpsLESS(1) LESS(1) 40160786Sps 40260786Sps 40360786Sps the number of lines in the file and the percent of 40460786Sps the file above the last displayed line. 40560786Sps 40660786Sps - Followed by one of the command line option letters 40760786Sps (see OPTIONS below), this will change the setting 40860786Sps of that option and print a message describing the 40960786Sps new setting. If a ^P (CONTROL-P) is entered imme- 41060786Sps diately after the dash, the setting of the option 41160786Sps is changed but no message is printed. If the 41260786Sps option letter has a numeric value (such as -b or 41360786Sps -h), or a string value (such as -P or -t), a new 41460786Sps value may be entered after the option letter. If 41560786Sps no new value is entered, a message describing the 41660786Sps current setting is printed and nothing is changed. 41760786Sps 41860786Sps -- Like the - command, but takes a long option name 41960786Sps (see OPTIONS below) rather than a single option 42060786Sps letter. You must press RETURN after typing the 42160786Sps option name. A ^P immediately after the second 42260786Sps dash suppresses printing of a message describing 42360786Sps the new setting, as in the - command. 42460786Sps 42560786Sps -+ Followed by one of the command line option letters 42660786Sps this will reset the option to its default setting 42760786Sps and print a message describing the new setting. 42860786Sps (The "-+_X" command does the same thing as "-+_X" on 42960786Sps the command line.) This does not work for string- 43060786Sps valued options. 43160786Sps 43260786Sps --+ Like the -+ command, but takes a long option name 43360786Sps rather than a single option letter. 43460786Sps 43560786Sps -! Followed by one of the command line option letters, 43660786Sps this will reset the option to the "opposite" of its 43760786Sps default setting and print a message describing the 43860786Sps new setting. This does not work for numeric or 43960786Sps string-valued options. 44060786Sps 44160786Sps --! Like the -! command, but takes a long option name 44260786Sps rather than a single option letter. 44360786Sps 44460786Sps _ (Underscore.) Followed by one of the command line 44560786Sps option letters, this will print a message describ- 44660786Sps ing the current setting of that option. The set- 44760786Sps ting of the option is not changed. 44860786Sps 44960786Sps __ (Double underscore.) Like the _ (underscore) com- 45060786Sps mand, but takes a long option name rather than a 45160786Sps single option letter. You must press RETURN after 45260786Sps typing the option name. 45360786Sps 45460786Sps +cmd Causes the specified cmd to be executed each time a 45560786Sps new file is examined. For example, +G causes _l_e_s_s 45660786Sps to initially display each file starting at the end 45760786Sps 45860786Sps 45960786Sps 46060786Sps Version 354: 23 Mar 2000 7 46160786Sps 46260786Sps 46360786Sps 46460786Sps 46560786Sps 46660786SpsLESS(1) LESS(1) 46760786Sps 46860786Sps 46960786Sps rather than the beginning. 47060786Sps 47160786Sps V Prints the version number of _l_e_s_s being run. 47260786Sps 47360786Sps q or Q or :q or :Q or ZZ 47460786Sps Exits _l_e_s_s_. 47560786Sps 47660786Sps The following four commands may or may not be valid, 47760786Sps depending on your particular installation. 47860786Sps 47960786Sps 48060786Sps v Invokes an editor to edit the current file being 48160786Sps viewed. The editor is taken from the environment 48260786Sps variable VISUAL if defined, or EDITOR if VISUAL is 48360786Sps not defined, or defaults to "vi" if neither VISUAL 48460786Sps nor EDITOR is defined. See also the discussion of 48560786Sps LESSEDIT under the section on PROMPTS below. 48660786Sps 48760786Sps ! shell-command 48860786Sps Invokes a shell to run the shell-command given. A 48960786Sps percent sign (%) in the command is replaced by the 49060786Sps name of the current file. A pound sign (#) is 49160786Sps replaced by the name of the previously examined 49260786Sps file. "!!" repeats the last shell command. "!" 49360786Sps with no shell command simply invokes a shell. On 49460786Sps Unix systems, the shell is taken from the environ- 49560786Sps ment variable SHELL, or defaults to "sh". On MS- 49660786Sps DOS and OS/2 systems, the shell is the normal com- 49760786Sps mand processor. 49860786Sps 49960786Sps | <m> shell-command 50060786Sps <m> represents any mark letter. Pipes a section of 50160786Sps the input file to the given shell command. The 50260786Sps section of the file to be piped is between the 50360786Sps first line on the current screen and the position 50460786Sps marked by the letter. <m> may also be ^ or $ to 50560786Sps indicate beginning or end of file respectively. If 50660786Sps <m> is . or newline, the current screen is piped. 50760786Sps 50860786Sps s filename 50960786Sps Save the input to a file. This only works if the 51060786Sps input is a pipe, not an ordinary file. 51160786Sps 51260786Sps 51360786SpsOOPPTTIIOONNSS 51460786Sps Command line options are described below. Most options 51560786Sps may be changed while _l_e_s_s is running, via the "-" command. 51660786Sps 51760786Sps Most options may be given in one of two forms: either a 51860786Sps dash followed by a single letter, or two dashes followed 51960786Sps by a long option name. A long option name may be abbrevi- 52060786Sps ated as long as the abbreviation is unambiguous. For 52160786Sps example, --quit-at-eof may be abbreviated --quit, but not 52260786Sps --qui, since both --quit-at-eof and --quiet begin with 52360786Sps 52460786Sps 52560786Sps 52660786Sps Version 354: 23 Mar 2000 8 52760786Sps 52860786Sps 52960786Sps 53060786Sps 53160786Sps 53260786SpsLESS(1) LESS(1) 53360786Sps 53460786Sps 53560786Sps --qui. Some long option names are in uppercase, such as 53660786Sps --QUIT-AT-EOF, as distinct from --quit-at-eof. Such 53760786Sps option names need only have their first letter capital- 53860786Sps ized; the remainder of the name may be in either case. 53960786Sps For example, --Quit-at-eof is equivalent to --QUIT-AT-EOF. 54060786Sps 54160786Sps Options are also taken from the environment variable 54260786Sps "LESS". For example, to avoid typing "less -options ..." 54360786Sps each time _l_e_s_s is invoked, you might tell _c_s_h_: 54460786Sps 54560786Sps setenv LESS "-options" 54660786Sps 54760786Sps or if you use _s_h_: 54860786Sps 54960786Sps LESS="-options"; export LESS 55060786Sps 55160786Sps On MS-DOS, you don't need the quotes, but you should 55260786Sps replace any percent signs in the options string by double 55360786Sps percent signs. 55460786Sps 55560786Sps The environment variable is parsed before the command 55660786Sps line, so command line options override the LESS environ- 55760786Sps ment variable. If an option appears in the LESS variable, 55860786Sps it can be reset to its default value on the command line 55960786Sps by beginning the command line option with "-+". 56060786Sps 56160786Sps For options like -P or -D which take a following string, a 56260786Sps dollar sign ($) must be used to signal the end of the 56360786Sps string. For example, to set two -D options on MS-DOS, you 56460786Sps must have a dollar sign between them, like this: 56560786Sps 56660786Sps LESS="-Dn9.1$-Ds4.1" 56760786Sps 56860786Sps 56960786Sps -? or --help 57060786Sps This option displays a summary of the commands 57160786Sps accepted by _l_e_s_s (the same as the h command). 57260786Sps (Depending on how your shell interprets the ques- 57360786Sps tion mark, it may be necessary to quote the ques- 57460786Sps tion mark, thus: "-\?".) 57560786Sps 57660786Sps -a or --search-skip-screen 57760786Sps Causes searches to start after the last line dis- 57860786Sps played on the screen, thus skipping all lines dis- 57960786Sps played on the screen. By default, searches start 58060786Sps at the second line on the screen (or after the last 58160786Sps found line; see the -j option). 58260786Sps 58360786Sps -b_n or --buffers=_n 58460786Sps Specifies the number of buffers _l_e_s_s will use for 58560786Sps each file. Buffers are 1K, and by default 10 58660786Sps buffers are used for each file (except if the file 58760786Sps is a pipe; see the -B option). The number _n speci- 58860786Sps fies a different number of buffers to use. 58960786Sps 59060786Sps 59160786Sps 59260786Sps Version 354: 23 Mar 2000 9 59360786Sps 59460786Sps 59560786Sps 59660786Sps 59760786Sps 59860786SpsLESS(1) LESS(1) 59960786Sps 60060786Sps 60160786Sps -B or --auto-buffers 60260786Sps By default, when data is read from a pipe, buffers 60360786Sps are allocated automatically as needed. If a large 60460786Sps amount of data is read from the pipe, this can 60560786Sps cause a large amount of memory to be allocated. 60660786Sps The -B option disables this automatic allocation of 60760786Sps buffers for pipes, so that only the number of 60860786Sps buffers specified by the -b option are used. Warn- 60960786Sps ing: use of -B can result in erroneous display, 61060786Sps since only the most recently viewed part of the 61160786Sps file is kept in memory; any earlier data is lost. 61260786Sps 61360786Sps -c or --clear-screen 61460786Sps Causes full screen repaints to be painted from the 61560786Sps top line down. By default, full screen repaints 61660786Sps are done by scrolling from the bottom of the 61760786Sps screen. 61860786Sps 61960786Sps -C or --CLEAR-SCREEN 62060786Sps The -C option is like -c, but the screen is cleared 62160786Sps before it is repainted. 62260786Sps 62360786Sps -d or --dumb 62460786Sps The -d option suppresses the error message normally 62560786Sps displayed if the terminal is dumb; that is, lacks 62660786Sps some important capability, such as the ability to 62760786Sps clear the screen or scroll backward. The -d option 62860786Sps does not otherwise change the behavior of _l_e_s_s on a 62960786Sps dumb terminal). 63060786Sps 63160786Sps -Dxx_c_o_l_o_r or --color=xx_c_o_l_o_r 63260786Sps [MS-DOS only] Sets the color of the text displayed. 63360786Sps xx is a single character which selects the type of 63460786Sps text whose color is being set: n=normal, s=stand- 63560786Sps out, d=bold, u=underlined, k=blink. _c_o_l_o_r is a 63660786Sps pair of numbers separated by a period. The first 63760786Sps number selects the foreground color and the second 63860786Sps selects the background color of the text. A single 63960786Sps number _N is the same as _N_._0. 64060786Sps 64160786Sps -e or --quit-at-eof 64260786Sps Causes _l_e_s_s to automatically exit the second time 64360786Sps it reaches end-of-file. By default, the only way 64460786Sps to exit _l_e_s_s is via the "q" command. 64560786Sps 64660786Sps -E or --QUIT-AT-EOF 64760786Sps Causes _l_e_s_s to automatically exit the first time it 64860786Sps reaches end-of-file. 64960786Sps 65060786Sps -f or --force 65160786Sps Forces non-regular files to be opened. (A non-reg- 65260786Sps ular file is a directory or a device special file.) 65360786Sps Also suppresses the warning message when a binary 65460786Sps file is opened. By default, _l_e_s_s will refuse to 65560786Sps 65660786Sps 65760786Sps 65860786Sps Version 354: 23 Mar 2000 10 65960786Sps 66060786Sps 66160786Sps 66260786Sps 66360786Sps 66460786SpsLESS(1) LESS(1) 66560786Sps 66660786Sps 66760786Sps open non-regular files. 66860786Sps 66960786Sps -F or --quit-if-one-screen 67060786Sps Causes _l_e_s_s to automatically exit if the entire 67160786Sps file can be displayed on the first screen. 67260786Sps 67360786Sps -g or --hilite-search 67460786Sps Normally, _l_e_s_s will highlight ALL strings which 67560786Sps match the last search command. The -g option 67660786Sps changes this behavior to highlight only the partic- 67760786Sps ular string which was found by the last search com- 67860786Sps mand. This can cause _l_e_s_s to run somewhat faster 67960786Sps than the default. 68060786Sps 68160786Sps -G or --HILITE-SEARCH 68260786Sps The -G option suppresses all highlighting of 68360786Sps strings found by search commands. 68460786Sps 68560786Sps -h_n or ---max-back-scroll=_n 68660786Sps Specifies a maximum number of lines to scroll back- 68760786Sps ward. If it is necessary to scroll backward more 68860786Sps than _n lines, the screen is repainted in a forward 68960786Sps direction instead. (If the terminal does not have 69060786Sps the ability to scroll backward, -h0 is implied.) 69160786Sps 69260786Sps -i or --ignore-case 69360786Sps Causes searches to ignore case; that is, uppercase 69460786Sps and lowercase are considered identical. This 69560786Sps option is ignored if any uppercase letters appear 69660786Sps in the search pattern; in other words, if a pattern 69760786Sps contains uppercase letters, then that search does 69860786Sps not ignore case. 69960786Sps 70060786Sps -I or --IGNORE-CASE 70160786Sps Like -i, but searches ignore case even if the pat- 70260786Sps tern contains uppercase letters. 70360786Sps 70460786Sps -j_n or --jump-target=_n 70560786Sps Specifies a line on the screen where the "target" 70660786Sps line is to be positioned. A target line is the 70760786Sps object of a text search, tag search, jump to a line 70860786Sps number, jump to a file percentage, or jump to a 70960786Sps marked position. The screen line is specified by a 71060786Sps number: the top line on the screen is 1, the next 71160786Sps is 2, and so on. The number may be negative to 71260786Sps specify a line relative to the bottom of the 71360786Sps screen: the bottom line on the screen is -1, the 71460786Sps second to the bottom is -2, and so on. If the -j 71560786Sps option is used, searches begin at the line immedi- 71660786Sps ately after the target line. For example, if "-j4" 71760786Sps is used, the target line is the fourth line on the 71860786Sps screen, so searches begin at the fifth line on the 71960786Sps screen. 72060786Sps 72160786Sps 72260786Sps 72360786Sps 72460786Sps Version 354: 23 Mar 2000 11 72560786Sps 72660786Sps 72760786Sps 72860786Sps 72960786Sps 73060786SpsLESS(1) LESS(1) 73160786Sps 73260786Sps 73360786Sps -k_f_i_l_e_n_a_m_e or --lesskey-file=_f_i_l_e_n_a_m_e 73460786Sps Causes _l_e_s_s to open and interpret the named file as 73560786Sps a _l_e_s_s_k_e_y (1) file. Multiple -k options may be 73660786Sps specified. If the LESSKEY or LESSKEY_SYSTEM envi- 73760786Sps ronment variable is set, or if a lesskey file is 73860786Sps found in a standard place (see KEY BINDINGS), it is 73960786Sps also used as a _l_e_s_s_k_e_y file. 74060786Sps 74160786Sps -m or --long-prompt 74260786Sps Causes _l_e_s_s to prompt verbosely (like _m_o_r_e), with 74360786Sps the percent into the file. By default, _l_e_s_s 74460786Sps prompts with a colon. 74560786Sps 74660786Sps -M or --LONG-PROMPT 74760786Sps Causes _l_e_s_s to prompt even more verbosely than 74860786Sps _m_o_r_e_. 74960786Sps 75060786Sps -n or --line-numbers 75160786Sps Suppresses line numbers. The default (to use line 75260786Sps numbers) may cause _l_e_s_s to run more slowly in some 75360786Sps cases, especially with a very large input file. 75460786Sps Suppressing line numbers with the -n option will 75560786Sps avoid this problem. Using line numbers means: the 75660786Sps line number will be displayed in the verbose prompt 75760786Sps and in the = command, and the v command will pass 75860786Sps the current line number to the editor (see also the 75960786Sps discussion of LESSEDIT in PROMPTS below). 76060786Sps 76160786Sps -N or --LINE-NUMBERS 76260786Sps Causes a line number to be displayed at the begin- 76360786Sps ning of each line in the display. 76460786Sps 76560786Sps -o_f_i_l_e_n_a_m_e or --log-file=_f_i_l_e_n_a_m_e 76660786Sps Causes _l_e_s_s to copy its input to the named file as 76760786Sps it is being viewed. This applies only when the 76860786Sps input file is a pipe, not an ordinary file. If the 76960786Sps file already exists, _l_e_s_s will ask for confirmation 77060786Sps before overwriting it. 77160786Sps 77260786Sps -O_f_i_l_e_n_a_m_e or --LOG-FILE=_f_i_l_e_n_a_m_e 77360786Sps The -O option is like -o, but it will overwrite an 77460786Sps existing file without asking for confirmation. 77560786Sps 77660786Sps If no log file has been specified, the -o and -O 77760786Sps options can be used from within _l_e_s_s to specify a 77860786Sps log file. Without a file name, they will simply 77960786Sps report the name of the log file. The "s" command 78060786Sps is equivalent to specifying -o from within _l_e_s_s_. 78160786Sps 78260786Sps -p_p_a_t_t_e_r_n or --pattern=_p_a_t_t_e_r_n 78360786Sps The -p option on the command line is equivalent to 78460786Sps specifying +/_p_a_t_t_e_r_n; that is, it tells _l_e_s_s to 78560786Sps start at the first occurrence of _p_a_t_t_e_r_n in the 78660786Sps file. 78760786Sps 78860786Sps 78960786Sps 79060786Sps Version 354: 23 Mar 2000 12 79160786Sps 79260786Sps 79360786Sps 79460786Sps 79560786Sps 79660786SpsLESS(1) LESS(1) 79760786Sps 79860786Sps 79960786Sps -P_p_r_o_m_p_t or --prompt=_p_r_o_m_p_t 80060786Sps Provides a way to tailor the three prompt styles to 80160786Sps your own preference. This option would normally be 80260786Sps put in the LESS environment variable, rather than 80360786Sps being typed in with each _l_e_s_s command. Such an 80460786Sps option must either be the last option in the LESS 80560786Sps variable, or be terminated by a dollar sign. -Ps 80660786Sps followed by a string changes the default (short) 80760786Sps prompt to that string. -Pm changes the medium (-m) 80860786Sps prompt. -PM changes the long (-M) prompt. -Ph 80960786Sps changes the prompt for the help screen. -P= 81060786Sps changes the message printed by the = command. All 81160786Sps prompt strings consist of a sequence of letters and 81260786Sps special escape sequences. See the section on 81360786Sps PROMPTS for more details. 81460786Sps 81560786Sps -q or --quiet or --silent 81660786Sps Causes moderately "quiet" operation: the terminal 81760786Sps bell is not rung if an attempt is made to scroll 81860786Sps past the end of the file or before the beginning of 81960786Sps the file. If the terminal has a "visual bell", it 82060786Sps is used instead. The bell will be rung on certain 82160786Sps other errors, such as typing an invalid character. 82260786Sps The default is to ring the terminal bell in all 82360786Sps such cases. 82460786Sps 82560786Sps -Q or --QUIET or --SILENT 82660786Sps Causes totally "quiet" operation: the terminal bell 82760786Sps is never rung. 82860786Sps 82960786Sps -r or --raw-control-chars 83060786Sps Causes "raw" control characters to be displayed. 83160786Sps The default is to display control characters using 83260786Sps the caret notation; for example, a control-A (octal 83360786Sps 001) is displayed as "^A". Warning: when the -r 83460786Sps option is used, _l_e_s_s cannot keep track of the 83560786Sps actual appearance of the screen (since this depends 83660786Sps on how the screen responds to each type of control 83760786Sps character). Thus, various display problems may 83860786Sps result, such as long lines being split in the wrong 83960786Sps place. 84060786Sps 84160786Sps -R or --RAW-CONTROL-CHARS 84260786Sps Like -r, but tries to keep track of the screen 84360786Sps appearance where possible. This works only if the 84460786Sps input consists of normal text and possibly some 84560786Sps ANSI "color" escape sequences, which are sequences 84660786Sps of the form: 84760786Sps 84860786Sps ESC [ ... m 84960786Sps 85060786Sps where the "..." is zero or more characters other 85160786Sps than "m". For the purpose of keeping track of 85260786Sps screen appearance, all control characters and all 85360786Sps 85460786Sps 85560786Sps 85660786Sps Version 354: 23 Mar 2000 13 85760786Sps 85860786Sps 85960786Sps 86060786Sps 86160786Sps 86260786SpsLESS(1) LESS(1) 86360786Sps 86460786Sps 86560786Sps ANSI color escape sequences are assumed to not move 86660786Sps the cursor. You can make _l_e_s_s think that charac- 86760786Sps ters other than "m" can end ANSI color escape 86860786Sps sequences by setting the environment variable 86960786Sps LESSANSIENDCHARS to the list of characters which 87060786Sps can end a color escape sequence. 87160786Sps 87260786Sps -s or --squeeze-blank-lines 87360786Sps Causes consecutive blank lines to be squeezed into 87460786Sps a single blank line. This is useful when viewing 87560786Sps _n_r_o_f_f output. 87660786Sps 87760786Sps -S or --chop-long-lines 87860786Sps Causes lines longer than the screen width to be 87960786Sps chopped rather than folded. That is, the remainder 88060786Sps of a long line is simply discarded. The default is 88160786Sps to fold long lines; that is, display the remainder 88260786Sps on the next line. 88360786Sps 88460786Sps -t_t_a_g or --tag=_t_a_g 88560786Sps The -t option, followed immediately by a TAG, will 88660786Sps edit the file containing that tag. For this to 88760786Sps work, there must be a file called "tags" in the 88860786Sps current directory, which was previously built by 88960786Sps the _c_t_a_g_s (1) command. This option may also be 89060786Sps specified from within _l_e_s_s (using the - command) as 89160786Sps a way of examining a new file. The command ":t" is 89260786Sps equivalent to specifying -t from within _l_e_s_s_. 89360786Sps 89460786Sps -T_t_a_g_s_f_i_l_e or --tag-file=_t_a_g_s_f_i_l_e 89560786Sps Specifies a tags file to be used instead of "tags". 89660786Sps 89760786Sps -u or --underline-special 89860786Sps Causes backspaces and carriage returns to be 89960786Sps treated as printable characters; that is, they are 90060786Sps sent to the terminal when they appear in the input. 90160786Sps 90260786Sps -U or --UNDERLINE-SPECIAL 90360786Sps Causes backspaces, tabs and carriage returns to be 90460786Sps treated as control characters; that is, they are 90560786Sps handled as specified by the -r option. 90660786Sps 90760786Sps By default, if neither -u nor -U is given, 90860786Sps backspaces which appear adjacent to an underscore 90960786Sps character are treated specially: the underlined 91060786Sps text is displayed using the terminal's hardware 91160786Sps underlining capability. Also, backspaces which 91260786Sps appear between two identical characters are treated 91360786Sps specially: the overstruck text is printed using the 91460786Sps terminal's hardware boldface capability. Other 91560786Sps backspaces are deleted, along with the preceding 91660786Sps character. Carriage returns immediately followed 91760786Sps by a newline are deleted. other carriage returns 91860786Sps are handled as specified by the -r option. Text 91960786Sps 92060786Sps 92160786Sps 92260786Sps Version 354: 23 Mar 2000 14 92360786Sps 92460786Sps 92560786Sps 92660786Sps 92760786Sps 92860786SpsLESS(1) LESS(1) 92960786Sps 93060786Sps 93160786Sps which is overstruck or underlined can be searched 93260786Sps for if neither -u nor -U is in effect. 93360786Sps 93460786Sps -V or --version 93560786Sps Displays the version number of _l_e_s_s_. 93660786Sps 93760786Sps -w or --hilite-unread 93860786Sps Temporarily highlights the first "new" line after a 93960786Sps forward movement of a full page. The first "new" 94060786Sps line is the line immediately following the line 94160786Sps previously at the bottom of the screen. Also high- 94260786Sps lights the target line after a g or p command. The 94360786Sps highlight is removed at the next command which 94460786Sps causes movement. 94560786Sps 94660786Sps -W or --HILITE-UNREAD 94760786Sps Like -w, but temporarily highlights the first new 94860786Sps line after any forward movement command larger than 94960786Sps one line. 95060786Sps 95160786Sps -x_n or --tabs=_n 95260786Sps Sets tab stops every _n positions. The default for 95360786Sps _n is 8. 95460786Sps 95560786Sps -X or --no-init 95660786Sps Disables sending the termcap initialization and 95760786Sps deinitialization strings to the terminal. This is 95860786Sps sometimes desirable if the deinitialization string 95960786Sps does something unnecessary, like clearing the 96060786Sps screen. 96160786Sps 96260786Sps -y_n or --max-forw-scroll=_n 96360786Sps Specifies a maximum number of lines to scroll for- 96460786Sps ward. If it is necessary to scroll forward more 96560786Sps than _n lines, the screen is repainted instead. The 96660786Sps -c or -C option may be used to repaint from the top 96760786Sps of the screen if desired. By default, any forward 96860786Sps movement causes scrolling. 96960786Sps 97060786Sps -[z]_n or --window=_n 97160786Sps Changes the default scrolling window size to _n 97260786Sps lines. The default is one screenful. The z and w 97360786Sps commands can also be used to change the window 97460786Sps size. The "z" may be omitted for compatibility 97560786Sps with _m_o_r_e_. If the number _n is negative, it indi- 97660786Sps cates _n lines less than the current screen size. 97760786Sps For example, if the screen is 24 lines, _-_z_-_4 sets 97860786Sps the scrolling window to 20 lines. If the screen is 97960786Sps resized to 40 lines, the scrolling window automati- 98060786Sps cally changes to 36 lines. 98160786Sps 98260786Sps -"_c_c or --quotes=_c_c 98360786Sps Changes the filename quoting character. This may 98460786Sps be necessary if you are trying to name a file which 98560786Sps 98660786Sps 98760786Sps 98860786Sps Version 354: 23 Mar 2000 15 98960786Sps 99060786Sps 99160786Sps 99260786Sps 99360786Sps 99460786SpsLESS(1) LESS(1) 99560786Sps 99660786Sps 99760786Sps contains both spaces and quote characters. Fol- 99860786Sps lowed by a single character, this changes the quote 99960786Sps character to that character. Filenames containing 100060786Sps a space should then be surrounded by that character 100160786Sps rather than by double quotes. Followed by two 100260786Sps characters, changes the open quote to the first 100360786Sps character, and the close quote to the second char- 100460786Sps acter. Filenames containing a space should then be 100560786Sps preceded by the open quote character and followed 100660786Sps by the close quote character. Note that even after 100760786Sps the quote characters are changed, this option 100860786Sps remains -" (a dash followed by a double quote). 100960786Sps 101060786Sps -~ or --tilde 101160786Sps Normally lines after end of file are displayed as a 101260786Sps single tilde (~). This option causes lines after 101360786Sps end of file to be displayed as blank lines. 101460786Sps 101560786Sps -- A command line argument of "--" marks the end of 101660786Sps option arguments. Any arguments following this are 101760786Sps interpreted as filenames. This can be useful when 101860786Sps viewing a file whose name begins with a "-" or "+". 101960786Sps 102060786Sps + If a command line option begins with ++, the remain- 102160786Sps der of that option is taken to be an initial com- 102260786Sps mand to _l_e_s_s_. For example, +G tells _l_e_s_s to start 102360786Sps at the end of the file rather than the beginning, 102460786Sps and +/xyz tells it to start at the first occurrence 102560786Sps of "xyz" in the file. As a special case, +<number> 102660786Sps acts like +<number>g; that is, it starts the dis- 102760786Sps play at the specified line number (however, see the 102860786Sps caveat under the "g" command above). If the option 102960786Sps starts with ++, the initial command applies to 103060786Sps every file being viewed, not just the first one. 103160786Sps The + command described previously may also be used 103260786Sps to set (or change) an initial command for every 103360786Sps file. 103460786Sps 103560786Sps 103660786SpsLLIINNEE EEDDIITTIINNGG 103760786Sps When entering command line at the bottom of the screen 103860786Sps (for example, a filename for the :e command, or the pat- 103960786Sps tern for a search command), certain keys can be used to 104060786Sps manipulate the command line. Most commands have an alter- 104160786Sps nate form in [ brackets ] which can be used if a key does 104260786Sps not exist on a particular keyboard. (The bracketed forms 104360786Sps do not work in the MS-DOS version.) Any of these special 104460786Sps keys may be entered literally by preceding it with the 104560786Sps "literal" character, either ^V or ^A. A backslash itself 104660786Sps may also be entered literally by entering two backslashes. 104760786Sps 104860786Sps LEFTARROW [ ESC-h ] 104960786Sps Move the cursor one space to the left. 105060786Sps 105160786Sps 105260786Sps 105360786Sps 105460786Sps Version 354: 23 Mar 2000 16 105560786Sps 105660786Sps 105760786Sps 105860786Sps 105960786Sps 106060786SpsLESS(1) LESS(1) 106160786Sps 106260786Sps 106360786Sps RIGHTARROW [ ESC-l ] 106460786Sps Move the cursor one space to the right. 106560786Sps 106660786Sps ^LEFTARROW [ ESC-b or ESC-LEFTARROW ] 106760786Sps (That is, CONTROL and LEFTARROW simultaneously.) 106860786Sps Move the cursor one word to the left. 106960786Sps 107060786Sps ^RIGHTARROW [ ESC-w or ESC-RIGHTARROW ] 107160786Sps (That is, CONTROL and RIGHTARROW simultaneously.) 107260786Sps Move the cursor one word to the right. 107360786Sps 107460786Sps HOME [ ESC-0 ] 107560786Sps Move the cursor to the beginning of the line. 107660786Sps 107760786Sps END [ ESC-$ ] 107860786Sps Move the cursor to the end of the line. 107960786Sps 108060786Sps BACKSPACE 108160786Sps Delete the character to the left of the cursor, or 108260786Sps cancel the command if the command line is empty. 108360786Sps 108460786Sps DELETE or [ ESC-x ] 108560786Sps Delete the character under the cursor. 108660786Sps 108760786Sps ^BACKSPACE [ ESC-BACKSPACE ] 108860786Sps (That is, CONTROL and BACKSPACE simultaneously.) 108960786Sps Delete the word to the left of the cursor. 109060786Sps 109160786Sps ^DELETE [ ESC-X or ESC-DELETE ] 109260786Sps (That is, CONTROL and DELETE simultaneously.) 109360786Sps Delete the word under the cursor. 109460786Sps 109560786Sps UPARROW [ ESC-k ] 109660786Sps Retrieve the previous command line. 109760786Sps 109860786Sps DOWNARROW [ ESC-j ] 109960786Sps Retrieve the next command line. 110060786Sps 110160786Sps TAB Complete the partial filename to the left of the 110260786Sps cursor. If it matches more than one filename, the 110360786Sps first match is entered into the command line. 110460786Sps Repeated TABs will cycle thru the other matching 110560786Sps filenames. If the completed filename is a direc- 110660786Sps tory, a "/" is appended to the filename. (On MS- 110760786Sps DOS systems, a "\" is appended.) The environment 110860786Sps variable LESSSEPARATOR can be used to specify a 110960786Sps different character to append to a directory name. 111060786Sps 111160786Sps BACKTAB [ ESC-TAB ] 111260786Sps Like, TAB, but cycles in the reverse direction thru 111360786Sps the matching filenames. 111460786Sps 111560786Sps ^L Complete the partial filename to the left of the 111660786Sps cursor. If it matches more than one filename, all 111760786Sps 111860786Sps 111960786Sps 112060786Sps Version 354: 23 Mar 2000 17 112160786Sps 112260786Sps 112360786Sps 112460786Sps 112560786Sps 112660786SpsLESS(1) LESS(1) 112760786Sps 112860786Sps 112960786Sps matches are entered into the command line (if they 113060786Sps fit). 113160786Sps 113260786Sps ^U (Unix) or ESC (MS-DOS) 113360786Sps Delete the entire command line, or cancel the com- 113460786Sps mand if the command line is empty. If you have 113560786Sps changed your line-kill character in Unix to some- 113660786Sps thing other than ^U, that character is used instead 113760786Sps of ^U. 113860786Sps 113960786Sps 114060786SpsKKEEYY BBIINNDDIINNGGSS 114160786Sps You may define your own _l_e_s_s commands by using the program 114260786Sps _l_e_s_s_k_e_y (1) to create a lesskey file. This file specifies 114360786Sps a set of command keys and an action associated with each 114460786Sps key. You may also use _l_e_s_s_k_e_y to change the line-editing 114560786Sps keys (see LINE EDITING), and to set environment variables. 114660786Sps If the environment variable LESSKEY is set, _l_e_s_s uses that 114760786Sps as the name of the lesskey file. Otherwise, _l_e_s_s looks in 114860786Sps a standard place for the lesskey file: On Unix systems, 114960786Sps _l_e_s_s looks for a lesskey file called "$HOME/.less". On 115060786Sps MS-DOS and Windows systems, _l_e_s_s looks for a lesskey file 115160786Sps called "$HOME/_less", and if it is not found there, then 115260786Sps looks for a lesskey file called "_less" in any directory 115360786Sps specified in the PATH environment variable. On OS/2 sys- 115460786Sps tems, _l_e_s_s looks for a lesskey file called 115560786Sps "$HOME/less.ini", and if it is not found, then looks for a 115660786Sps lesskey file called "less.ini" in any directory specified 115760786Sps in the INIT environment variable, and if it not found 115860786Sps there, then looks for a lesskey file called "less.ini" in 115960786Sps any directory specified in the PATH environment variable. 116060786Sps See the _l_e_s_s_k_e_y manual page for more details. 116160786Sps 116260786Sps A system-wide lesskey file may also be set up to provide 116360786Sps key bindings. If a key is defined in both a local lesskey 116460786Sps file and in the system-wide file, key bindings in the 116560786Sps local file take precedence over those in the system-wide 116660786Sps file. If the environment variable LESSKEY_SYSTEM is set, 116760786Sps _l_e_s_s uses that as the name of the system-wide lesskey 116860786Sps file. Otherwise, _l_e_s_s looks in a standard place for the 116960786Sps system-wide lesskey file: On Unix systems, the system-wide 117060786Sps lesskey file is /usr/local/bin/.sysless. (However, if 117160786Sps _l_e_s_s was built with a different binary directory than 117260786Sps /usr/local/bin, that directory is where the .sysless file 117360786Sps is found.) On MS-DOS and Windows systems, the system-wide 117460786Sps lesskey file is c:\_sysless. On OS/2 systems, the system- 117560786Sps wide lesskey file is c:\sysless.ini. 117660786Sps 117760786Sps 117860786SpsIINNPPUUTT PPRREEPPRROOCCEESSSSOORR 117960786Sps You may define an "input preprocessor" for _l_e_s_s_. Before 118060786Sps _l_e_s_s opens a file, it first gives your input preprocessor 118160786Sps a chance to modify the way the contents of the file are 118260786Sps displayed. An input preprocessor is simply an executable 118360786Sps 118460786Sps 118560786Sps 118660786Sps Version 354: 23 Mar 2000 18 118760786Sps 118860786Sps 118960786Sps 119060786Sps 119160786Sps 119260786SpsLESS(1) LESS(1) 119360786Sps 119460786Sps 119560786Sps program (or shell script), which writes the contents of 119660786Sps the file to a different file, called the replacement file. 119760786Sps The contents of the replacement file are then displayed in 119860786Sps place of the contents of the original file. However, it 119960786Sps will appear to the user as if the original file is opened; 120060786Sps that is, _l_e_s_s will display the original filename as the 120160786Sps name of the current file. 120260786Sps 120360786Sps An input preprocessor receives one command line argument, 120460786Sps the original filename, as entered by the user. It should 120560786Sps create the replacement file, and when finished, print the 120660786Sps name of the replacement file to its standard output. If 120760786Sps the input preprocessor does not output a replacement file- 120860786Sps name, _l_e_s_s uses the original file, as normal. The input 120960786Sps preprocessor is not called when viewing standard input. 121060786Sps To set up an input preprocessor, set the LESSOPEN environ- 121160786Sps ment variable to a command line which will invoke your 121260786Sps input preprocessor. This command line should include one 121360786Sps occurrence of the string "%s", which will be replaced by 121460786Sps the filename when the input preprocessor command is 121560786Sps invoked. 121660786Sps 121760786Sps When _l_e_s_s closes a file opened in such a way, it will call 121860786Sps another program, called the input postprocessor, which may 121960786Sps perform any desired clean-up action (such as deleting the 122060786Sps replacement file created by LESSOPEN). This program 122160786Sps receives two command line arguments, the original filename 122260786Sps as entered by the user, and the name of the replacement 122360786Sps file. To set up an input postprocessor, set the LESSCLOSE 122460786Sps environment variable to a command line which will invoke 122560786Sps your input postprocessor. It may include two occurrences 122660786Sps of the string "%s"; the first is replaced with the origi- 122760786Sps nal name of the file and the second with the name of the 122860786Sps replacement file, which was output by LESSOPEN. 122960786Sps 123060786Sps For example, on many Unix systems, these two scripts will 123160786Sps allow you to keep files in compressed format, but still 123260786Sps let _l_e_s_s view them directly: 123360786Sps 123460786Sps lessopen.sh: 123560786Sps #! /bin/sh 123660786Sps case "$1" in 123760786Sps *.Z) uncompress -c $1 >/tmp/less.$$ 2>/dev/null 123860786Sps if [ -s /tmp/less.$$ ]; then 123960786Sps echo /tmp/less.$$ 124060786Sps else 124160786Sps rm -f /tmp/less.$$ 124260786Sps fi 124360786Sps ;; 124460786Sps esac 124560786Sps 124660786Sps lessclose.sh: 124760786Sps #! /bin/sh 124860786Sps rm $2 124960786Sps 125060786Sps 125160786Sps 125260786Sps Version 354: 23 Mar 2000 19 125360786Sps 125460786Sps 125560786Sps 125660786Sps 125760786Sps 125860786SpsLESS(1) LESS(1) 125960786Sps 126060786Sps 126160786Sps To use these scripts, put them both where they can be exe- 126260786Sps cuted and set LESSOPEN="lessopen.sh %s", and 126360786Sps LESSCLOSE="lessclose.sh %s %s". More complex LESSOPEN and 126460786Sps LESSCLOSE scripts may be written to accept other types of 126560786Sps compressed files, and so on. 126660786Sps 126760786Sps It is also possible to set up an input preprocessor to 126860786Sps pipe the file data directly to _l_e_s_s_, rather than putting 126960786Sps the data into a replacement file. This avoids the need to 127060786Sps decompress the entire file before starting to view it. An 127160786Sps input preprocessor that works this way is called an input 127260786Sps pipe. An input pipe, instead of writing the name of a 127360786Sps replacement file on its standard output, writes the entire 127460786Sps contents of the replacement file on its standard output. 127560786Sps If the input pipe does not write any characters on its 127660786Sps standard output, then there is no replacement file and 127760786Sps _l_e_s_s uses the original file, as normal. To use an input 127860786Sps pipe, make the first character in the LESSOPEN environment 127960786Sps variable a vertical bar (|) to signify that the input pre- 128060786Sps processor is an input pipe. 128160786Sps 128260786Sps For example, on many Unix systems, this script will work 128360786Sps like the previous example scripts: 128460786Sps 128560786Sps lesspipe.sh: 128660786Sps #! /bin/sh 128760786Sps case "$1" in 128860786Sps *.Z) uncompress -c $1 2>/dev/null 128960786Sps ;; 129060786Sps esac 129160786Sps 129260786Sps To use this script, put it where it can be executed and 129360786Sps set LESSOPEN="|lesspipe.sh %s". When an input pipe is 129460786Sps used, a LESSCLOSE postprocessor can be used, but it is 129560786Sps usually not necessary since there is no replacement file 129660786Sps to clean up. In this case, the replacement file name 129760786Sps passed to the LESSCLOSE postprocessor is "-". 129860786Sps 129960786Sps 130060786SpsNNAATTIIOONNAALL CCHHAARRAACCTTEERR SSEETTSS 130160786Sps There are three types of characters in the input file: 130260786Sps 130360786Sps normal characters 130460786Sps can be displayed directly to the screen. 130560786Sps 130660786Sps control characters 130760786Sps should not be displayed directly, but are expected 130860786Sps to be found in ordinary text files (such as 130960786Sps backspace and tab). 131060786Sps 131160786Sps binary characters 131260786Sps should not be displayed directly and are not 131360786Sps expected to be found in text files. 131460786Sps 131560786Sps 131660786Sps 131760786Sps 131860786Sps Version 354: 23 Mar 2000 20 131960786Sps 132060786Sps 132160786Sps 132260786Sps 132360786Sps 132460786SpsLESS(1) LESS(1) 132560786Sps 132660786Sps 132760786Sps A "character set" is simply a description of which charac- 132860786Sps ters are to be considered normal, control, and binary. 132960786Sps The LESSCHARSET environment variable may be used to select 133060786Sps a character set. Possible values for LESSCHARSET are: 133160786Sps 133260786Sps ascii BS, TAB, NL, CR, and formfeed are control charac- 133360786Sps ters, all chars with values between 32 and 126 are 133460786Sps normal, and all others are binary. 133560786Sps 133660786Sps iso8859 133760786Sps Selects an ISO 8859 character set. This is the 133860786Sps same as ASCII, except characters between 160 and 133960786Sps 255 are treated as normal characters. 134060786Sps 134160786Sps latin1 Same as iso8859. 134260786Sps 134360786Sps dos Selects a character set appropriate for MS-DOS. 134460786Sps 134560786Sps ebcdic Selects an EBCDIC character set. 134660786Sps 134760786Sps koi8-r Selects a Russian character set. 134860786Sps 134960786Sps next Selects a character set appropriate for NeXT com- 135060786Sps puters. 135160786Sps 135260786Sps utf-8 Selects the UTF-8 encoding of the ISO 10646 charac- 135360786Sps ter set. 135460786Sps 135560786Sps If the LESSCHARSET environment variable is not set, the 135660786Sps default character set is latin1. However, if the string 135760786Sps "UTF-8" is found in the LC_ALL, LC_CTYPE or LANG environ- 135860786Sps ment variables, then the default character set is utf-8 135960786Sps instead. 136060786Sps 136160786Sps In special cases, it may be desired to tailor _l_e_s_s to use 136260786Sps a character set other than the ones definable by LESS- 136360786Sps CHARSET. In this case, the environment variable LESS- 136460786Sps CHARDEF can be used to define a character set. It should 136560786Sps be set to a string where each character in the string rep- 136660786Sps resents one character in the character set. The character 136760786Sps "." is used for a normal character, "c" for control, and 136860786Sps "b" for binary. A decimal number may be used for repeti- 136960786Sps tion. For example, "bccc4b." would mean character 0 is 137060786Sps binary, 1, 2 and 3 are control, 4, 5, 6 and 7 are binary, 137160786Sps and 8 is normal. All characters after the last are taken 137260786Sps to be the same as the last, so characters 9 through 255 137360786Sps would be normal. (This is an example, and does not neces- 137460786Sps sarily represent any real character set.) 137560786Sps 137660786Sps This table shows the value of LESSCHARDEF which is equiva- 137760786Sps lent to each of the possible values for LESSCHARSET: 137860786Sps 137960786Sps ascii 8bcccbcc18b95.b 138060786Sps dos 8bcccbcc12bc5b95.b. 138160786Sps 138260786Sps 138360786Sps 138460786Sps Version 354: 23 Mar 2000 21 138560786Sps 138660786Sps 138760786Sps 138860786Sps 138960786Sps 139060786SpsLESS(1) LESS(1) 139160786Sps 139260786Sps 139360786Sps ebcdic 5bc6bcc7bcc41b.9b7.9b5.b..8b6.10b6.b9.7b 139460786Sps 9.8b8.17b3.3b9.7b9.8b8.6b10.b.b.b. 139560786Sps iso8859 8bcccbcc18b95.33b. 139660786Sps koi8-r 8bcccbcc18b95.b128. 139760786Sps latin1 8bcccbcc18b95.33b. 139860786Sps next 8bcccbcc18b95.bb125.bb 139960786Sps 140060786Sps If neither LESSCHARSET nor LESSCHARDEF is set, but your 140160786Sps system supports the _s_e_t_l_o_c_a_l_e interface, _l_e_s_s will use 140260786Sps setlocale to determine the character set. setlocale is 140360786Sps controlled by setting the LANG or LC_CTYPE environment 140460786Sps variables. 140560786Sps 140660786Sps Control and binary characters are displayed in standout 140760786Sps (reverse video). Each such character is displayed in 140860786Sps caret notation if possible (e.g. ^A for control-A). Caret 140960786Sps notation is used only if inverting the 0100 bit results in 141060786Sps a normal printable character. Otherwise, the character is 141160786Sps displayed as a hex number in angle brackets. This format 141260786Sps can be changed by setting the LESSBINFMT environment vari- 141360786Sps able. LESSBINFMT may begin with a "*" and one character 141460786Sps to select the display attribute: "*k" is blinking, "*d" is 141560786Sps bold, "*u" is underlined, "*s" is standout, and "*n" is 141660786Sps normal. If LESSBINFMT does not begin with a "*", normal 141760786Sps attribute is assumed. The remainder of LESSBINFMT is a 141860786Sps string which may include one printf-style escape sequence 141960786Sps (a % followed by x, X, o, d, etc.). For example, if LESS- 142060786Sps BINFMT is "*u[%x]", binary characters are displayed in 142160786Sps underlined hexadecimal surrounded by brackets. The 142260786Sps default if no LESSBINFMT is specified is "*s<%X>". 142360786Sps 142460786Sps 142560786SpsPPRROOMMPPTTSS 142660786Sps The -P option allows you to tailor the prompt to your 142760786Sps preference. The string given to the -P option replaces 142860786Sps the specified prompt string. Certain characters in the 142960786Sps string are interpreted specially. The prompt mechanism is 143060786Sps rather complicated to provide flexibility, but the ordi- 143160786Sps nary user need not understand the details of constructing 143260786Sps personalized prompt strings. 143360786Sps 143460786Sps A percent sign followed by a single character is expanded 143560786Sps according to what the following character is: 143660786Sps 143760786Sps %b_X Replaced by the byte offset into the current input 143860786Sps file. The b is followed by a single character 143960786Sps (shown as _X above) which specifies the line whose 144060786Sps byte offset is to be used. If the character is a 144160786Sps "t", the byte offset of the top line in the display 144260786Sps is used, an "m" means use the middle line, a "b" 144360786Sps means use the bottom line, a "B" means use the line 144460786Sps just after the bottom line, and a "j" means use the 144560786Sps "target" line, as specified by the -j option. 144660786Sps 144760786Sps 144860786Sps 144960786Sps 145060786Sps Version 354: 23 Mar 2000 22 145160786Sps 145260786Sps 145360786Sps 145460786Sps 145560786Sps 145660786SpsLESS(1) LESS(1) 145760786Sps 145860786Sps 145960786Sps %B Replaced by the size of the current input file. 146060786Sps 146160786Sps %c Replaced by the column number of the text appearing 146260786Sps in the first column of the screen. 146360786Sps 146460786Sps %d_X Replaced by the page number of a line in the input 146560786Sps file. The line to be used is determined by the _X, 146660786Sps as with the %b option. 146760786Sps 146860786Sps %D Replaced by the number of pages in the input file, 146960786Sps or equivalently, the page number of the last line 147060786Sps in the input file. 147160786Sps 147260786Sps %E Replaced by the name of the editor (from the VISUAL 147360786Sps environment variable, or the EDITOR environment 147460786Sps variable if VISUAL is not defined). See the dis- 147560786Sps cussion of the LESSEDIT feature below. 147660786Sps 147760786Sps %f Replaced by the name of the current input file. 147860786Sps 147960786Sps %i Replaced by the index of the current file in the 148060786Sps list of input files. 148160786Sps 148260786Sps %l_X Replaced by the line number of a line in the input 148360786Sps file. The line to be used is determined by the _X, 148460786Sps as with the %b option. 148560786Sps 148660786Sps %L Replaced by the line number of the last line in the 148760786Sps input file. 148860786Sps 148960786Sps %m Replaced by the total number of input files. 149060786Sps 149160786Sps %p_X Replaced by the percent into the current input 149260786Sps file, based on byte offsets. The line used is 149360786Sps determined by the _X as with the %b option. 149460786Sps 149560786Sps %P_X Replaced by the percent into the current input 149660786Sps file, based on line numbers. The line used is 149760786Sps determined by the _X as with the %b option. 149860786Sps 149960786Sps %s Same as %B. 150060786Sps 150160786Sps %t Causes any trailing spaces to be removed. Usually 150260786Sps used at the end of the string, but may appear any- 150360786Sps where. 150460786Sps 150560786Sps %x Replaced by the name of the next input file in the 150660786Sps list. 150760786Sps 150860786Sps If any item is unknown (for example, the file size if 150960786Sps input is a pipe), a question mark is printed instead. 151060786Sps 151160786Sps The format of the prompt string can be changed depending 151260786Sps on certain conditions. A question mark followed by a 151360786Sps 151460786Sps 151560786Sps 151660786Sps Version 354: 23 Mar 2000 23 151760786Sps 151860786Sps 151960786Sps 152060786Sps 152160786Sps 152260786SpsLESS(1) LESS(1) 152360786Sps 152460786Sps 152560786Sps single character acts like an "IF": depending on the fol- 152660786Sps lowing character, a condition is evaluated. If the condi- 152760786Sps tion is true, any characters following the question mark 152860786Sps and condition character, up to a period, are included in 152960786Sps the prompt. If the condition is false, such characters 153060786Sps are not included. A colon appearing between the question 153160786Sps mark and the period can be used to establish an "ELSE": 153260786Sps any characters between the colon and the period are 153360786Sps included in the string if and only if the IF condition is 153460786Sps false. Condition characters (which follow a question 153560786Sps mark) may be: 153660786Sps 153760786Sps ?a True if any characters have been included in the 153860786Sps prompt so far. 153960786Sps 154060786Sps ?b_X True if the byte offset of the specified line is 154160786Sps known. 154260786Sps 154360786Sps ?B True if the size of current input file is known. 154460786Sps 154560786Sps ?c True if the text is horizontally shifted (%c is not 154660786Sps zero). 154760786Sps 154860786Sps ?d_X True if the page number of the specified line is 154960786Sps known. 155060786Sps 155160786Sps ?e True if at end-of-file. 155260786Sps 155360786Sps ?f True if there is an input filename (that is, if 155460786Sps input is not a pipe). 155560786Sps 155660786Sps ?l_X True if the line number of the specified line is 155760786Sps known. 155860786Sps 155960786Sps ?L True if the line number of the last line in the 156060786Sps file is known. 156160786Sps 156260786Sps ?m True if there is more than one input file. 156360786Sps 156460786Sps ?n True if this is the first prompt in a new input 156560786Sps file. 156660786Sps 156760786Sps ?p_X True if the percent into the current input file, 156860786Sps based on byte offsets, of the specified line is 156960786Sps known. 157060786Sps 157160786Sps ?P_X True if the percent into the current input file, 157260786Sps based on line numbers, of the specified line is 157360786Sps known. 157460786Sps 157560786Sps ?s Same as "?B". 157660786Sps 157760786Sps ?x True if there is a next input file (that is, if the 157860786Sps current input file is not the last one). 157960786Sps 158060786Sps 158160786Sps 158260786Sps Version 354: 23 Mar 2000 24 158360786Sps 158460786Sps 158560786Sps 158660786Sps 158760786Sps 158860786SpsLESS(1) LESS(1) 158960786Sps 159060786Sps 159160786Sps Any characters other than the special ones (question mark, 159260786Sps colon, period, percent, and backslash) become literally 159360786Sps part of the prompt. Any of the special characters may be 159460786Sps included in the prompt literally by preceding it with a 159560786Sps backslash. 159660786Sps 159760786Sps Some examples: 159860786Sps 159960786Sps ?f%f:Standard input. 160060786Sps 160160786Sps This prompt prints the filename, if known; otherwise the 160260786Sps string "Standard input". 160360786Sps 160460786Sps ?f%f .?ltLine %lt:?pt%pt\%:?btByte %bt:-... 160560786Sps 160660786Sps This prompt would print the filename, if known. The file- 160760786Sps name is followed by the line number, if known, otherwise 160860786Sps the percent if known, otherwise the byte offset if known. 160960786Sps Otherwise, a dash is printed. Notice how each question 161060786Sps mark has a matching period, and how the % after the %pt is 161160786Sps included literally by escaping it with a backslash. 161260786Sps 161360786Sps ?n?f%f .?m(file %i of %m) ..?e(END) ?x- Next\: %x..%t 161460786Sps 161560786Sps This prints the filename if this is the first prompt in a 161660786Sps file, followed by the "file N of N" message if there is 161760786Sps more than one input file. Then, if we are at end-of-file, 161860786Sps the string "(END)" is printed followed by the name of the 161960786Sps next file, if there is one. Finally, any trailing spaces 162060786Sps are truncated. This is the default prompt. For refer- 162160786Sps ence, here are the defaults for the other two prompts (-m 162260786Sps and -M respectively). Each is broken into two lines here 162360786Sps for readability only. 162460786Sps 162560786Sps ?n?f%f .?m(file %i of %m) ..?e(END) ?x- Next\: %x.: 162660786Sps ?pB%pB\%:byte %bB?s/%s...%t 162760786Sps 162860786Sps ?f%f .?n?m(file %i of %m) ..?ltlines %lt-%lb?L/%L. : 162960786Sps byte %bB?s/%s. .?e(END) ?x- Next\: %x.:?pB%pB\%..%t 163060786Sps 163160786Sps And here is the default message produced by the = command: 163260786Sps 163360786Sps ?f%f .?m(file %i of %m) .?ltlines %lt-%lb?L/%L. . 163460786Sps byte %bB?s/%s. ?e(END) :?pB%pB\%..%t 163560786Sps 163660786Sps The prompt expansion features are also used for another 163760786Sps purpose: if an environment variable LESSEDIT is defined, 163860786Sps it is used as the command to be executed when the v com- 163960786Sps mand is invoked. The LESSEDIT string is expanded in the 164060786Sps same way as the prompt strings. The default value for 164160786Sps LESSEDIT is: 164260786Sps 164360786Sps %E ?lm+%lm. %f 164460786Sps 164560786Sps 164660786Sps 164760786Sps 164860786Sps Version 354: 23 Mar 2000 25 164960786Sps 165060786Sps 165160786Sps 165260786Sps 165360786Sps 165460786SpsLESS(1) LESS(1) 165560786Sps 165660786Sps 165760786Sps Note that this expands to the editor name, followed by a + 165860786Sps and the line number, followed by the file name. If your 165960786Sps editor does not accept the "+linenumber" syntax, or has 166060786Sps other differences in invocation syntax, the LESSEDIT vari- 166160786Sps able can be changed to modify this default. 166260786Sps 166360786Sps 166460786SpsSSEECCUURRIITTYY 166560786Sps When the environment variable LESSSECURE is set to 1, _l_e_s_s 166660786Sps runs in a "secure" mode. This means these features are 166760786Sps disabled: 166860786Sps 166960786Sps ! the shell command 167060786Sps 167160786Sps | the pipe command 167260786Sps 167360786Sps :e the examine command. 167460786Sps 167560786Sps v the editing command 167660786Sps 167760786Sps s -o log files 167860786Sps 167960786Sps -k use of lesskey files 168060786Sps 168160786Sps -t use of tags files 168260786Sps 168360786Sps metacharacters in filenames, such as * 168460786Sps 168560786Sps filename completion (TAB, ^L) 168660786Sps 168760786Sps Less can also be compiled to be permanently in "secure" 168860786Sps mode. 168960786Sps 169060786Sps 169160786SpsEENNVVIIRROONNMMEENNTT VVAARRIIAABBLLEESS 169260786Sps Environment variables may be specified either in the sys- 169360786Sps tem environment as usual, or in a _l_e_s_s_k_e_y (1) file. If 169460786Sps environment variables are defined in more than one place, 169560786Sps variables defined in a local lesskey file take precedence 169660786Sps over variables defined in the system environment, which 169760786Sps take precedence over variables defined in the system-wide 169860786Sps lesskey file. 169960786Sps 170060786Sps COLUMNS 170160786Sps Sets the number of columns on the screen. Takes 170260786Sps precedence over the number of columns specified by 170360786Sps the TERM variable. (But if you have a windowing 170460786Sps system which supports TIOCGWINSZ or WIOCGETD, the 170560786Sps window system's idea of the screen size takes 170660786Sps precedence over the LINES and COLUMNS environment 170760786Sps variables.) 170860786Sps 170960786Sps EDITOR The name of the editor (used for the v command). 171060786Sps 171160786Sps 171260786Sps 171360786Sps 171460786Sps Version 354: 23 Mar 2000 26 171560786Sps 171660786Sps 171760786Sps 171860786Sps 171960786Sps 172060786SpsLESS(1) LESS(1) 172160786Sps 172260786Sps 172360786Sps HOME Name of the user's home directory (used to find a 172460786Sps lesskey file on Unix systems). 172560786Sps 172660786Sps HOMEDRIVE, HOMEPATH 172760786Sps Concatenation of the HOMEDRIVE and HOMEPATH envi- 172860786Sps ronment variables is the name of the user's home 172960786Sps directory if the HOME variable is not set (only in 173060786Sps the Windows version). 173160786Sps 173260786Sps INIT Name of the user's init directory (used to find a 173360786Sps lesskey file on OS/2 systems). 173460786Sps 173560786Sps LANG Language for determining the character set. 173660786Sps 173760786Sps LC_CTYPE 173860786Sps Language for determining the character set. 173960786Sps 174060786Sps LESS Options which are passed to _l_e_s_s automatically. 174160786Sps 174260786Sps LESSANSIENDCHARS 174360786Sps Characters which are assumed to end an ANSI color 174460786Sps escape sequence (default "m"). 174560786Sps 174660786Sps LESSBINFMT 174760786Sps Format for displaying non-printable, non-control 174860786Sps characters. 174960786Sps 175060786Sps LESSCHARDEF 175160786Sps Defines a character set. 175260786Sps 175360786Sps LESSCHARSET 175460786Sps Selects a predefined character set. 175560786Sps 175660786Sps LESSCLOSE 175760786Sps Command line to invoke the (optional) input-post- 175860786Sps processor. 175960786Sps 176060786Sps LESSECHO 176160786Sps Name of the lessecho program (default "lessecho"). 176260786Sps The lessecho program is needed to expand metachar- 176360786Sps acters, such as * and ?, in filenames on Unix sys- 176460786Sps tems. 176560786Sps 176660786Sps LESSEDIT 176760786Sps Editor prototype string (used for the v command). 176860786Sps See discussion under PROMPTS. 176960786Sps 177060786Sps LESSKEY 177160786Sps Name of the default lesskey(1) file. 177260786Sps 177360786Sps LESSKEY_SYSTEM 177460786Sps Name of the default system-wide lesskey(1) file. 177560786Sps 177660786Sps 177760786Sps 177860786Sps 177960786Sps 178060786Sps Version 354: 23 Mar 2000 27 178160786Sps 178260786Sps 178360786Sps 178460786Sps 178560786Sps 178660786SpsLESS(1) LESS(1) 178760786Sps 178860786Sps 178960786Sps LESSMETACHARS 179060786Sps List of characters which are considered "metachar- 179160786Sps acters" by the shell. 179260786Sps 179360786Sps LESSMETAESCAPE 179460786Sps Prefix which less will add before each metacharac- 179560786Sps ter in a command sent to the shell. If LESS- 179660786Sps METAESCAPE is an empty string, commands containing 179760786Sps metacharacters will not be passed to the shell. 179860786Sps 179960786Sps LESSOPEN 180060786Sps Command line to invoke the (optional) input-prepro- 180160786Sps cessor. 180260786Sps 180360786Sps LESSSECURE 180460786Sps Runs less in "secure" mode. See discussion under 180560786Sps SECURITY. 180660786Sps 180760786Sps LESSSEPARATOR 180860786Sps String to be appended to a directory name in file- 180960786Sps name completion. 181060786Sps 181160786Sps LINES Sets the number of lines on the screen. Takes 181260786Sps precedence over the number of lines specified by 181360786Sps the TERM variable. (But if you have a windowing 181460786Sps system which supports TIOCGWINSZ or WIOCGETD, the 181560786Sps window system's idea of the screen size takes 181660786Sps precedence over the LINES and COLUMNS environment 181760786Sps variables.) 181860786Sps 181960786Sps PATH User's search path (used to find a lesskey file on 182060786Sps MS-DOS and OS/2 systems). 182160786Sps 182260786Sps SHELL The shell used to execute the ! command, as well as 182360786Sps to expand filenames. 182460786Sps 182560786Sps TERM The type of terminal on which _l_e_s_s is being run. 182660786Sps 182760786Sps VISUAL The name of the editor (used for the v command). 182860786Sps 182960786Sps 183060786SpsSSEEEE AALLSSOO 183160786Sps lesskey(1) 183260786Sps 183360786Sps 183460786SpsWWAARRNNIINNGGSS 183560786Sps The = command and prompts (unless changed by -P) report 183660786Sps the line numbers of the lines at the top and bottom of the 183760786Sps screen, but the byte and percent of the line after the one 183860786Sps at the bottom of the screen. 183960786Sps 184060786Sps If the :e command is used to name more than one file, and 184160786Sps one of the named files has been viewed previously, the new 184260786Sps files may be entered into the list in an unexpected order. 184360786Sps 184460786Sps 184560786Sps 184660786Sps Version 354: 23 Mar 2000 28 184760786Sps 184860786Sps 184960786Sps 185060786Sps 185160786Sps 185260786SpsLESS(1) LESS(1) 185360786Sps 185460786Sps 185560786Sps On certain older terminals (the so-called "magic cookie" 185660786Sps terminals), search highlighting will cause an erroneous 185760786Sps display. On such terminals, search highlighting is dis- 185860786Sps abled by default to avoid possible problems. 185960786Sps 186060786Sps In certain cases, when search highlighting is enabled and 186160786Sps a search pattern begins with a ^, more text than the 186260786Sps matching string may be highlighted. (This problem does 186360786Sps not occur when less is compiled to use the POSIX regular 186460786Sps expression package.) 186560786Sps 186660786Sps On some systems, _s_e_t_l_o_c_a_l_e claims that ASCII characters 0 186760786Sps thru 31 are control characters rather than binary charac- 186860786Sps ters. This causes _l_e_s_s to treat some binary files as 186960786Sps ordinary, non-binary files. To workaround this problem, 187060786Sps set the environment variable LESSCHARSET to "ascii" (or 187160786Sps whatever character set is appropriate). 187260786Sps 187360786Sps See http://www.flash.net/~marknu/less for the latest list 187460786Sps of known bugs in this version of less. 187560786Sps 187660786Sps 187760786SpsCCOOPPYYRRIIGGHHTT 187860786Sps Copyright (C) 2000 Mark Nudelman 187960786Sps 188060786Sps less is part of the GNU project and is free software. You 188160786Sps can redistribute it and/or modify it under the terms of 188260786Sps either (1) the GNU General Public License as published by 188360786Sps the Free Software Foundation; or (2) the Less License. 188460786Sps See the file README in the less distribution for more 188560786Sps details regarding redistribution. You should have 188660786Sps received a copy of the GNU General Public License along 188760786Sps with the source for less; see the file COPYING. If not, 188860786Sps write to the Free Software Foundation, 59 Temple Place, 188960786Sps Suite 330, Boston, MA 02111-1307, USA. You should also 189060786Sps have received a copy of the Less License; see the file 189160786Sps LICENSE. 189260786Sps 189360786Sps less is distributed in the hope that it will be useful, 189460786Sps but WITHOUT ANY WARRANTY; without even the implied war- 189560786Sps ranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR- 189660786Sps POSE. See the GNU General Public License for more 189760786Sps details. 189860786Sps 189960786Sps 190060786SpsAAUUTTHHOORR 190160786Sps Mark Nudelman <marknu@flash.net> 190260786Sps Send bug reports or comments to the above address or to 190360786Sps bug-less@gnu.org. 190460786Sps 190560786Sps 190660786Sps 190760786Sps 190860786Sps 190960786Sps 191060786Sps 191160786Sps 191260786Sps Version 354: 23 Mar 2000 29 191360786Sps 191460786Sps 1915