1*e4a6e799SsimonbLESS(1) General Commands Manual LESS(1) 2*e4a6e799Ssimonb 3*e4a6e799Ssimonb 4*e4a6e799Ssimonb 5*e4a6e799Ssimonb[1mNAME[0m 6*e4a6e799Ssimonb less - opposite of more 7*e4a6e799Ssimonb 8*e4a6e799Ssimonb[1mSYNOPSIS[0m 9*e4a6e799Ssimonb [1mless -?[0m 10*e4a6e799Ssimonb [1mless --help[0m 11*e4a6e799Ssimonb [1mless -V[0m 12*e4a6e799Ssimonb [1mless --version[0m 13*e4a6e799Ssimonb [1mless [-[+]aABcCdeEfFgGiIJKLmMnNqQrRsSuUVwWX~][0m 14*e4a6e799Ssimonb [1m[-b [4m[22mspace[24m[1m] [-h [4m[22mlines[24m[1m] [-j [4m[22mline[24m[1m] [-k [4m[22mkeyfile[24m[1m][0m 15*e4a6e799Ssimonb [1m[-{oO} [4m[22mlogfile[24m[1m] [-p [4m[22mpattern[24m[1m] [-P [4m[22mprompt[24m[1m] [-t [4m[22mtag[24m[1m][0m 16*e4a6e799Ssimonb [1m[-T [4m[22mtagsfile[24m[1m] [-x [4m[22mtab[24m[1m,...] [-y [4m[22mlines[24m[1m] [-[z] [4m[22mlines[24m[1m][0m 17*e4a6e799Ssimonb [1m[-# [4m[22mshift[24m[1m] [+[+][4m[22mcmd[24m[1m] [--] [[4m[22mfilename[24m[1m]...[0m 18*e4a6e799Ssimonb (See the OPTIONS section for alternate option syntax with long option 19*e4a6e799Ssimonb names.) 20*e4a6e799Ssimonb 21*e4a6e799Ssimonb[1mDESCRIPTION[0m 22*e4a6e799Ssimonb [1mLess [22mis a program similar to [1mmore[22m(1), but which allows backward move‐ 23*e4a6e799Ssimonb ment in the file as well as forward movement. Also, [1mless [22mdoes not have 24*e4a6e799Ssimonb to read the entire input file before starting, so with large input 25*e4a6e799Ssimonb files it starts up faster than text editors like [1mvi[22m(1). [1mLess [22muses 26*e4a6e799Ssimonb termcap (or terminfo on some systems), so it can run on a variety of 27*e4a6e799Ssimonb terminals. There is even limited support for hardcopy terminals. (On 28*e4a6e799Ssimonb a hardcopy terminal, lines which should be printed at the top of the 29*e4a6e799Ssimonb screen are prefixed with a caret.) 30*e4a6e799Ssimonb 31*e4a6e799Ssimonb Commands are based on both [1mmore [22mand [1mvi[22m. Commands may be preceded by a 32*e4a6e799Ssimonb decimal number, called N in the descriptions below. The number is used 33*e4a6e799Ssimonb by some commands, as indicated. 34*e4a6e799Ssimonb 35*e4a6e799Ssimonb[1mCOMMANDS[0m 36*e4a6e799Ssimonb In the following descriptions, ^X means control-X. ESC stands for the 37*e4a6e799Ssimonb ESCAPE key; for example ESC-v means the two character sequence "ES‐ 38*e4a6e799Ssimonb CAPE", then "v". 39*e4a6e799Ssimonb 40*e4a6e799Ssimonb h or H Help: display a summary of these commands. If you forget all 41*e4a6e799Ssimonb the other commands, remember this one. 42*e4a6e799Ssimonb 43*e4a6e799Ssimonb SPACE or ^V or f or ^F 44*e4a6e799Ssimonb Scroll forward N lines, default one window (see option -z be‐ 45*e4a6e799Ssimonb low). If N is more than the screen size, only the final screen‐ 46*e4a6e799Ssimonb ful is displayed. Warning: some systems use ^V as a special 47*e4a6e799Ssimonb literalization character. 48*e4a6e799Ssimonb 49*e4a6e799Ssimonb z Like SPACE, but if N is specified, it becomes the new window 50*e4a6e799Ssimonb size. 51*e4a6e799Ssimonb 52*e4a6e799Ssimonb ESC-SPACE 53*e4a6e799Ssimonb Like SPACE, but scrolls a full screenful, even if it reaches 54*e4a6e799Ssimonb end-of-file in the process. 55*e4a6e799Ssimonb 56*e4a6e799Ssimonb ENTER or RETURN or ^N or e or ^E or j or ^J 57*e4a6e799Ssimonb Scroll forward N lines, default 1. The entire N lines are dis‐ 58*e4a6e799Ssimonb played, even if N is more than the screen size. 59*e4a6e799Ssimonb 60*e4a6e799Ssimonb d or ^D 61*e4a6e799Ssimonb Scroll forward N lines, default one half of the screen size. If 62*e4a6e799Ssimonb N is specified, it becomes the new default for subsequent d and 63*e4a6e799Ssimonb u commands. 64*e4a6e799Ssimonb 65*e4a6e799Ssimonb b or ^B or ESC-v 66*e4a6e799Ssimonb Scroll backward N lines, default one window (see option -z be‐ 67*e4a6e799Ssimonb low). If N is more than the screen size, only the final screen‐ 68*e4a6e799Ssimonb ful is displayed. 69*e4a6e799Ssimonb 70*e4a6e799Ssimonb w Like ESC-v, but if N is specified, it becomes the new window 71*e4a6e799Ssimonb size. 72*e4a6e799Ssimonb 73*e4a6e799Ssimonb y or ^Y or ^P or k or ^K 74*e4a6e799Ssimonb Scroll backward N lines, default 1. The entire N lines are dis‐ 75*e4a6e799Ssimonb played, even if N is more than the screen size. Warning: some 76*e4a6e799Ssimonb systems use ^Y as a special job control character. 77*e4a6e799Ssimonb 78*e4a6e799Ssimonb u or ^U 79*e4a6e799Ssimonb Scroll backward N lines, default one half of the screen size. 80*e4a6e799Ssimonb If N is specified, it becomes the new default for subsequent d 81*e4a6e799Ssimonb and u commands. 82*e4a6e799Ssimonb 83*e4a6e799Ssimonb J Like j, but continues to scroll beyond the end of the file. 84*e4a6e799Ssimonb 85*e4a6e799Ssimonb K or Y Like k, but continues to scroll beyond the beginning of the 86*e4a6e799Ssimonb file. 87*e4a6e799Ssimonb 88*e4a6e799Ssimonb ESC-) or RIGHTARROW 89*e4a6e799Ssimonb Scroll horizontally right N characters, default half the screen 90*e4a6e799Ssimonb width (see the -# option). If a number N is specified, it be‐ 91*e4a6e799Ssimonb comes the default for future RIGHTARROW and LEFTARROW commands. 92*e4a6e799Ssimonb While the text is scrolled, it acts as though the -S option 93*e4a6e799Ssimonb (chop lines) were in effect. 94*e4a6e799Ssimonb 95*e4a6e799Ssimonb ESC-( or LEFTARROW 96*e4a6e799Ssimonb Scroll horizontally left N characters, default half the screen 97*e4a6e799Ssimonb width (see the -# option). If a number N is specified, it be‐ 98*e4a6e799Ssimonb comes the default for future RIGHTARROW and LEFTARROW commands. 99*e4a6e799Ssimonb 100*e4a6e799Ssimonb ESC-} or ^RIGHTARROW 101*e4a6e799Ssimonb Scroll horizontally right to show the end of the longest dis‐ 102*e4a6e799Ssimonb played line. 103*e4a6e799Ssimonb 104*e4a6e799Ssimonb ESC-{ or ^LEFTARROW 105*e4a6e799Ssimonb Scroll horizontally left back to the first column. 106*e4a6e799Ssimonb 107*e4a6e799Ssimonb r or ^R or ^L 108*e4a6e799Ssimonb Repaint the screen. 109*e4a6e799Ssimonb 110*e4a6e799Ssimonb R Repaint the screen, discarding any buffered input. That is, 111*e4a6e799Ssimonb reload the current file. Useful if the file is changing while 112*e4a6e799Ssimonb it is being viewed. 113*e4a6e799Ssimonb 114*e4a6e799Ssimonb F Scroll forward, and keep trying to read when the end of file is 115*e4a6e799Ssimonb reached. Normally this command would be used when already at 116*e4a6e799Ssimonb the end of the file. It is a way to monitor the tail of a file 117*e4a6e799Ssimonb which is growing while it is being viewed. (The behavior is 118*e4a6e799Ssimonb similar to the "tail -f" command.) To stop waiting for more 119*e4a6e799Ssimonb data, enter the interrupt character (usually ^C). On systems 120*e4a6e799Ssimonb which support [1mpoll[22m(2) you can also use ^X or the character spec‐ 121*e4a6e799Ssimonb ified by the --intr option. If the input is a pipe and the 122*e4a6e799Ssimonb --exit-follow-on-close option is in effect, [1mless [22mwill automati‐ 123*e4a6e799Ssimonb cally stop waiting for data when the input side of the pipe is 124*e4a6e799Ssimonb closed. 125*e4a6e799Ssimonb 126*e4a6e799Ssimonb ESC-F Like F, but as soon as a line is found which matches the last 127*e4a6e799Ssimonb search pattern, the terminal bell is rung and forward scrolling 128*e4a6e799Ssimonb stops. 129*e4a6e799Ssimonb 130*e4a6e799Ssimonb g or < or ESC-< 131*e4a6e799Ssimonb Go to line N in the file, default 1 (beginning of file). (Warn‐ 132*e4a6e799Ssimonb ing: this may be slow if N is large.) 133*e4a6e799Ssimonb 134*e4a6e799Ssimonb G or > or ESC-> 135*e4a6e799Ssimonb Go to line N in the file, default the end of the file. (Warn‐ 136*e4a6e799Ssimonb ing: this may be slow if N is large, or if N is not specified 137*e4a6e799Ssimonb and standard input, rather than a file, is being read.) 138*e4a6e799Ssimonb 139*e4a6e799Ssimonb ESC-G Same as G, except if no number N is specified and the input is 140*e4a6e799Ssimonb standard input, goes to the last line which is currently 141*e4a6e799Ssimonb buffered. 142*e4a6e799Ssimonb 143*e4a6e799Ssimonb p or % Go to a position N percent into the file. N should be between 0 144*e4a6e799Ssimonb and 100, and may contain a decimal point. 145*e4a6e799Ssimonb 146*e4a6e799Ssimonb P Go to the line containing byte offset N in the file. 147*e4a6e799Ssimonb 148*e4a6e799Ssimonb { If a left curly bracket appears in the top line displayed on the 149*e4a6e799Ssimonb screen, the { command will go to the matching right curly 150*e4a6e799Ssimonb bracket. The matching right curly bracket is positioned on the 151*e4a6e799Ssimonb bottom line of the screen. If there is more than one left curly 152*e4a6e799Ssimonb bracket on the top line, a number N may be used to specify the 153*e4a6e799Ssimonb N-th bracket on the line. 154*e4a6e799Ssimonb 155*e4a6e799Ssimonb } If a right curly bracket appears in the bottom line displayed on 156*e4a6e799Ssimonb the screen, the } command will go to the matching left curly 157*e4a6e799Ssimonb bracket. The matching left curly bracket is positioned on the 158*e4a6e799Ssimonb top line of the screen. If there is more than one right curly 159*e4a6e799Ssimonb bracket on the bottom line, a number N may be used to specify 160*e4a6e799Ssimonb the N-th bracket on the line. 161*e4a6e799Ssimonb 162*e4a6e799Ssimonb ( Like {, but applies to parentheses rather than curly brackets. 163*e4a6e799Ssimonb 164*e4a6e799Ssimonb ) Like }, but applies to parentheses rather than curly brackets. 165*e4a6e799Ssimonb 166*e4a6e799Ssimonb [ Like {, but applies to square brackets rather than curly brack‐ 167*e4a6e799Ssimonb ets. 168*e4a6e799Ssimonb 169*e4a6e799Ssimonb ] Like }, but applies to square brackets rather than curly brack‐ 170*e4a6e799Ssimonb ets. 171*e4a6e799Ssimonb 172*e4a6e799Ssimonb ESC-^F Followed by two characters, acts like {, but uses the two char‐ 173*e4a6e799Ssimonb acters as open and close brackets, respectively. For example, 174*e4a6e799Ssimonb "ESC ^F < >" could be used to go forward to the > which matches 175*e4a6e799Ssimonb the < in the top displayed line. 176*e4a6e799Ssimonb 177*e4a6e799Ssimonb ESC-^B Followed by two characters, acts like }, but uses the two char‐ 178*e4a6e799Ssimonb acters as open and close brackets, respectively. For example, 179*e4a6e799Ssimonb "ESC ^B < >" could be used to go backward to the < which matches 180*e4a6e799Ssimonb the > in the bottom displayed line. 181*e4a6e799Ssimonb 182*e4a6e799Ssimonb m Followed by any lowercase or uppercase letter, marks the first 183*e4a6e799Ssimonb displayed line with that letter. If the status column is en‐ 184*e4a6e799Ssimonb abled via the -J option, the status column shows the marked 185*e4a6e799Ssimonb line. 186*e4a6e799Ssimonb 187*e4a6e799Ssimonb M Acts like m, except the last displayed line is marked rather 188*e4a6e799Ssimonb than the first displayed line. 189*e4a6e799Ssimonb 190*e4a6e799Ssimonb ' (Single quote.) Followed by any lowercase or uppercase letter, 191*e4a6e799Ssimonb returns to the position which was previously marked with that 192*e4a6e799Ssimonb letter. Followed by another single quote, returns to the posi‐ 193*e4a6e799Ssimonb tion at which the last "large" movement command was executed. 194*e4a6e799Ssimonb Followed by a ^ or $, jumps to the beginning or end of the file 195*e4a6e799Ssimonb respectively. Marks are preserved when a new file is examined, 196*e4a6e799Ssimonb so the ' command can be used to switch between input files. 197*e4a6e799Ssimonb 198*e4a6e799Ssimonb ^X^X Same as single quote. 199*e4a6e799Ssimonb 200*e4a6e799Ssimonb ESC-m Followed by any lowercase or uppercase letter, clears the mark 201*e4a6e799Ssimonb identified by that letter. 202*e4a6e799Ssimonb 203*e4a6e799Ssimonb /pattern 204*e4a6e799Ssimonb Search forward in the file for the N-th line containing the pat‐ 205*e4a6e799Ssimonb tern. N defaults to 1. The pattern is a regular expression, as 206*e4a6e799Ssimonb recognized by the regular expression library supplied by your 207*e4a6e799Ssimonb system. By default, searching is case-sensitive (uppercase and 208*e4a6e799Ssimonb lowercase are considered different); the -i option can be used 209*e4a6e799Ssimonb to change this. The search starts at the first line displayed 210*e4a6e799Ssimonb (but see the -a and -j options, which change this). 211*e4a6e799Ssimonb 212*e4a6e799Ssimonb Certain characters are special if entered at the beginning of 213*e4a6e799Ssimonb the pattern; they modify the type of search rather than become 214*e4a6e799Ssimonb part of the pattern: 215*e4a6e799Ssimonb 216*e4a6e799Ssimonb ^N or ! 217*e4a6e799Ssimonb Search for lines which do NOT match the pattern. 218*e4a6e799Ssimonb 219*e4a6e799Ssimonb ^E or * 220*e4a6e799Ssimonb Search multiple files. That is, if the search reaches 221*e4a6e799Ssimonb the END of the current file without finding a match, the 222*e4a6e799Ssimonb search continues in the next file in the command line 223*e4a6e799Ssimonb list. 224*e4a6e799Ssimonb 225*e4a6e799Ssimonb ^F or @ 226*e4a6e799Ssimonb Begin the search at the first line of the FIRST file in 227*e4a6e799Ssimonb the command line list, regardless of what is currently 228*e4a6e799Ssimonb displayed on the screen or the settings of the -a or -j 229*e4a6e799Ssimonb options. 230*e4a6e799Ssimonb 231*e4a6e799Ssimonb ^K Highlight any text which matches the pattern on the cur‐ 232*e4a6e799Ssimonb rent screen, but don't move to the first match (KEEP cur‐ 233*e4a6e799Ssimonb rent position). 234*e4a6e799Ssimonb 235*e4a6e799Ssimonb ^R Don't interpret regular expression metacharacters; that 236*e4a6e799Ssimonb is, do a simple textual comparison. 237*e4a6e799Ssimonb 238*e4a6e799Ssimonb ^S Followed by a digit N between 1 and 5. Only text which 239*e4a6e799Ssimonb has a non-empty match for the N-th parenthesized SUB-PAT‐ 240*e4a6e799Ssimonb TERN will be considered to match the pattern. (Supported 241*e4a6e799Ssimonb only if [1mless [22mis built with one of the regular expression 242*e4a6e799Ssimonb libraries [1mposix[22m, [1mpcre[22m, or [1mpcre2[22m.) Multiple ^S modifiers 243*e4a6e799Ssimonb can be specified, to match more than one sub-pattern. 244*e4a6e799Ssimonb 245*e4a6e799Ssimonb ^W WRAP around the current file. That is, if the search 246*e4a6e799Ssimonb reaches the end of the current file without finding a 247*e4a6e799Ssimonb match, the search continues from the first line of the 248*e4a6e799Ssimonb current file up to the line where it started. If the ^W 249*e4a6e799Ssimonb modifier is set, the ^E modifier is ignored. 250*e4a6e799Ssimonb 251*e4a6e799Ssimonb ?pattern 252*e4a6e799Ssimonb Search backward in the file for the N-th line containing the 253*e4a6e799Ssimonb pattern. The search starts at the last line displayed (but see 254*e4a6e799Ssimonb the -a and -j options, which change this). 255*e4a6e799Ssimonb 256*e4a6e799Ssimonb Certain characters are special as in the / command: 257*e4a6e799Ssimonb 258*e4a6e799Ssimonb ^N or ! 259*e4a6e799Ssimonb Search for lines which do NOT match the pattern. 260*e4a6e799Ssimonb 261*e4a6e799Ssimonb ^E or * 262*e4a6e799Ssimonb Search multiple files. That is, if the search reaches 263*e4a6e799Ssimonb the beginning of the current file without finding a 264*e4a6e799Ssimonb match, the search continues in the previous file in the 265*e4a6e799Ssimonb command line list. 266*e4a6e799Ssimonb 267*e4a6e799Ssimonb ^F or @ 268*e4a6e799Ssimonb Begin the search at the last line of the last file in the 269*e4a6e799Ssimonb command line list, regardless of what is currently dis‐ 270*e4a6e799Ssimonb played on the screen or the settings of the -a or -j op‐ 271*e4a6e799Ssimonb tions. 272*e4a6e799Ssimonb 273*e4a6e799Ssimonb ^K As in forward searches. 274*e4a6e799Ssimonb 275*e4a6e799Ssimonb ^R As in forward searches. 276*e4a6e799Ssimonb 277*e4a6e799Ssimonb ^S As in forward searches. 278*e4a6e799Ssimonb 279*e4a6e799Ssimonb ^W WRAP around the current file. That is, if the search 280*e4a6e799Ssimonb reaches the beginning of the current file without finding 281*e4a6e799Ssimonb a match, the search continues from the last line of the 282*e4a6e799Ssimonb current file up to the line where it started. 283*e4a6e799Ssimonb 284*e4a6e799Ssimonb ESC-/pattern 285*e4a6e799Ssimonb Same as "/*". 286*e4a6e799Ssimonb 287*e4a6e799Ssimonb ESC-?pattern 288*e4a6e799Ssimonb Same as "?*". 289*e4a6e799Ssimonb 290*e4a6e799Ssimonb n Repeat previous search, for N-th line containing the last pat‐ 291*e4a6e799Ssimonb tern. If the previous search was modified by ^N, the search is 292*e4a6e799Ssimonb made for the N-th line NOT containing the pattern. If the pre‐ 293*e4a6e799Ssimonb vious search was modified by ^E, the search continues in the 294*e4a6e799Ssimonb next (or previous) file if not satisfied in the current file. 295*e4a6e799Ssimonb If the previous search was modified by ^R, the search is done 296*e4a6e799Ssimonb without using regular expressions. There is no effect if the 297*e4a6e799Ssimonb previous search was modified by ^F or ^K. 298*e4a6e799Ssimonb 299*e4a6e799Ssimonb N Repeat previous search, but in the reverse direction. 300*e4a6e799Ssimonb 301*e4a6e799Ssimonb ESC-n Repeat previous search, but crossing file boundaries. The ef‐ 302*e4a6e799Ssimonb fect is as if the previous search were modified by *. 303*e4a6e799Ssimonb 304*e4a6e799Ssimonb ESC-N Repeat previous search, but in the reverse direction and cross‐ 305*e4a6e799Ssimonb ing file boundaries. 306*e4a6e799Ssimonb 307*e4a6e799Ssimonb ESC-u Undo search highlighting. Turn off highlighting of strings 308*e4a6e799Ssimonb matching the current search pattern. If highlighting is already 309*e4a6e799Ssimonb off because of a previous ESC-u command, turn highlighting back 310*e4a6e799Ssimonb on. Any search command will also turn highlighting back on. 311*e4a6e799Ssimonb (Highlighting can also be disabled by toggling the -G option; in 312*e4a6e799Ssimonb that case search commands do not turn highlighting back on.) 313*e4a6e799Ssimonb 314*e4a6e799Ssimonb ESC-U Like ESC-u but also clears the saved search pattern. If the 315*e4a6e799Ssimonb status column is enabled via the -J option, this clears all 316*e4a6e799Ssimonb search matches marked in the status column. 317*e4a6e799Ssimonb 318*e4a6e799Ssimonb &pattern 319*e4a6e799Ssimonb Display only lines which match the pattern; lines which do not 320*e4a6e799Ssimonb match the pattern are not displayed. If pattern is empty (if 321*e4a6e799Ssimonb you type & immediately followed by ENTER), any filtering is 322*e4a6e799Ssimonb turned off, and all lines are displayed. While filtering is in 323*e4a6e799Ssimonb effect, an ampersand is displayed at the beginning of the 324*e4a6e799Ssimonb prompt, as a reminder that some lines in the file may be hidden. 325*e4a6e799Ssimonb Multiple & commands may be entered, in which case only lines 326*e4a6e799Ssimonb which match all of the patterns will be displayed. 327*e4a6e799Ssimonb 328*e4a6e799Ssimonb Certain characters are special as in the / command: 329*e4a6e799Ssimonb 330*e4a6e799Ssimonb ^N or ! 331*e4a6e799Ssimonb Display only lines which do NOT match the pattern. 332*e4a6e799Ssimonb 333*e4a6e799Ssimonb ^R Don't interpret regular expression metacharacters; that 334*e4a6e799Ssimonb is, do a simple textual comparison. 335*e4a6e799Ssimonb 336*e4a6e799Ssimonb :e [filename] 337*e4a6e799Ssimonb Examine a new file. If the filename is missing, the "current" 338*e4a6e799Ssimonb file (see the :n and :p commands below) from the list of files 339*e4a6e799Ssimonb in the command line is re-examined. A percent sign (%) in the 340*e4a6e799Ssimonb filename is replaced by the name of the current file. A pound 341*e4a6e799Ssimonb sign (#) is replaced by the name of the previously examined 342*e4a6e799Ssimonb file. However, two consecutive percent signs are simply re‐ 343*e4a6e799Ssimonb placed with a single percent sign. This allows you to enter a 344*e4a6e799Ssimonb filename that contains a percent sign in the name. Similarly, 345*e4a6e799Ssimonb two consecutive pound signs are replaced with a single pound 346*e4a6e799Ssimonb sign. The filename is inserted into the command line list of 347*e4a6e799Ssimonb files so that it can be seen by subsequent :n and :p commands. 348*e4a6e799Ssimonb If the filename consists of several files, they are all inserted 349*e4a6e799Ssimonb into the list of files and the first one is examined. If the 350*e4a6e799Ssimonb filename contains one or more spaces, the entire filename should 351*e4a6e799Ssimonb be enclosed in double quotes (also see the -" option). 352*e4a6e799Ssimonb 353*e4a6e799Ssimonb ^X^V or E 354*e4a6e799Ssimonb Same as :e. Warning: some systems use ^V as a special literal‐ 355*e4a6e799Ssimonb ization character. On such systems, you may not be able to use 356*e4a6e799Ssimonb ^V. 357*e4a6e799Ssimonb 358*e4a6e799Ssimonb :n Examine the next file (from the list of files given in the com‐ 359*e4a6e799Ssimonb mand line). If a number N is specified, the N-th next file is 360*e4a6e799Ssimonb examined. 361*e4a6e799Ssimonb 362*e4a6e799Ssimonb :p Examine the previous file in the command line list. If a number 363*e4a6e799Ssimonb N is specified, the N-th previous file is examined. 364*e4a6e799Ssimonb 365*e4a6e799Ssimonb :x Examine the first file in the command line list. If a number N 366*e4a6e799Ssimonb is specified, the N-th file in the list is examined. 367*e4a6e799Ssimonb 368*e4a6e799Ssimonb :d Remove the current file from the list of files. 369*e4a6e799Ssimonb 370*e4a6e799Ssimonb t Go to the next tag, if there were more than one matches for the 371*e4a6e799Ssimonb current tag. See the -t option for more details about tags. 372*e4a6e799Ssimonb 373*e4a6e799Ssimonb T Go to the previous tag, if there were more than one matches for 374*e4a6e799Ssimonb the current tag. 375*e4a6e799Ssimonb 376*e4a6e799Ssimonb = or ^G or :f 377*e4a6e799Ssimonb Prints some information about the file being viewed, including 378*e4a6e799Ssimonb its name and the line number and byte offset of the bottom line 379*e4a6e799Ssimonb being displayed. If possible, it also prints the length of the 380*e4a6e799Ssimonb file, the number of lines in the file and the percent of the 381*e4a6e799Ssimonb file above the last displayed line. 382*e4a6e799Ssimonb 383*e4a6e799Ssimonb - Followed by one of the command line option letters (see OPTIONS 384*e4a6e799Ssimonb below), this will change the setting of that option and print a 385*e4a6e799Ssimonb message describing the new setting. If a ^P (CONTROL-P) is en‐ 386*e4a6e799Ssimonb tered immediately after the dash, the setting of the option is 387*e4a6e799Ssimonb changed but no message is printed. If the option letter has a 388*e4a6e799Ssimonb numeric value (such as -b or -h), or a string value (such as -P 389*e4a6e799Ssimonb or -t), a new value may be entered after the option letter. If 390*e4a6e799Ssimonb no new value is entered, a message describing the current set‐ 391*e4a6e799Ssimonb ting is printed and nothing is changed. 392*e4a6e799Ssimonb 393*e4a6e799Ssimonb -- Like the - command, but takes a long option name (see OPTIONS 394*e4a6e799Ssimonb below) rather than a single option letter. You must press ENTER 395*e4a6e799Ssimonb or RETURN after typing the option name. A ^P immediately after 396*e4a6e799Ssimonb the second dash suppresses printing of a message describing the 397*e4a6e799Ssimonb new setting, as in the - command. 398*e4a6e799Ssimonb 399*e4a6e799Ssimonb -+ Followed by one of the command line option letters this will re‐ 400*e4a6e799Ssimonb set the option to its default setting and print a message de‐ 401*e4a6e799Ssimonb scribing the new setting. (The "-+[4mX[24m" command does the same 402*e4a6e799Ssimonb thing as "-+[4mX[24m" on the command line.) This does not work for 403*e4a6e799Ssimonb string-valued options. 404*e4a6e799Ssimonb 405*e4a6e799Ssimonb --+ Like the -+ command, but takes a long option name rather than a 406*e4a6e799Ssimonb single option letter. 407*e4a6e799Ssimonb 408*e4a6e799Ssimonb -! Followed by one of the command line option letters, this will 409*e4a6e799Ssimonb reset the option to the "opposite" of its default setting and 410*e4a6e799Ssimonb print a message describing the new setting. This does not work 411*e4a6e799Ssimonb for numeric or string-valued options. 412*e4a6e799Ssimonb 413*e4a6e799Ssimonb --! Like the -! command, but takes a long option name rather than a 414*e4a6e799Ssimonb single option letter. 415*e4a6e799Ssimonb 416*e4a6e799Ssimonb _ (Underscore.) Followed by one of the command line option let‐ 417*e4a6e799Ssimonb ters, this will print a message describing the current setting 418*e4a6e799Ssimonb of that option. The setting of the option is not changed. 419*e4a6e799Ssimonb 420*e4a6e799Ssimonb __ (Double underscore.) Like the _ (underscore) command, but takes 421*e4a6e799Ssimonb a long option name rather than a single option letter. You must 422*e4a6e799Ssimonb press ENTER or RETURN after typing the option name. 423*e4a6e799Ssimonb 424*e4a6e799Ssimonb +cmd Causes the specified cmd to be executed each time a new file is 425*e4a6e799Ssimonb examined. For example, +G causes [1mless [22mto initially display each 426*e4a6e799Ssimonb file starting at the end rather than the beginning. 427*e4a6e799Ssimonb 428*e4a6e799Ssimonb V Prints the version number of [1mless [22mbeing run. 429*e4a6e799Ssimonb 430*e4a6e799Ssimonb q or Q or :q or :Q or ZZ 431*e4a6e799Ssimonb Exits [1mless[22m. 432*e4a6e799Ssimonb 433*e4a6e799Ssimonb The following six commands may or may not be valid, depending on your 434*e4a6e799Ssimonb particular installation. 435*e4a6e799Ssimonb 436*e4a6e799Ssimonb v Invokes an editor to edit the current file being viewed. The 437*e4a6e799Ssimonb editor is taken from the environment variable VISUAL if defined, 438*e4a6e799Ssimonb or EDITOR if VISUAL is not defined, or defaults to "vi" if nei‐ 439*e4a6e799Ssimonb ther VISUAL nor EDITOR is defined. See also the discussion of 440*e4a6e799Ssimonb LESSEDIT under the section on PROMPTS below. 441*e4a6e799Ssimonb 442*e4a6e799Ssimonb ! shell-command 443*e4a6e799Ssimonb Invokes a shell to run the shell-command given. A percent sign 444*e4a6e799Ssimonb (%) in the command is replaced by the name of the current file. 445*e4a6e799Ssimonb A pound sign (#) is replaced by the name of the previously exam‐ 446*e4a6e799Ssimonb ined file. "!!" repeats the last shell command. "!" with no 447*e4a6e799Ssimonb shell command simply invokes a shell. On Unix systems, the 448*e4a6e799Ssimonb shell is taken from the environment variable SHELL, or defaults 449*e4a6e799Ssimonb to "sh". On MS-DOS and OS/2 systems, the shell is the normal 450*e4a6e799Ssimonb command processor. 451*e4a6e799Ssimonb 452*e4a6e799Ssimonb # shell-command 453*e4a6e799Ssimonb Similar to the "!" command, except that the command is expanded 454*e4a6e799Ssimonb in the same way as prompt strings. For example, the name of the 455*e4a6e799Ssimonb current file would be given as "%f". 456*e4a6e799Ssimonb 457*e4a6e799Ssimonb | <m> shell-command 458*e4a6e799Ssimonb <m> represents any mark letter. Pipes a section of the input 459*e4a6e799Ssimonb file to the given shell command. The section of the file to be 460*e4a6e799Ssimonb piped is between the position marked by the letter and the cur‐ 461*e4a6e799Ssimonb rent screen. The entire current screen is included, regardless 462*e4a6e799Ssimonb of whether the marked position is before or after the current 463*e4a6e799Ssimonb screen. <m> may also be ^ or $ to indicate beginning or end of 464*e4a6e799Ssimonb file respectively. If <m> is . or newline, the current screen 465*e4a6e799Ssimonb is piped. 466*e4a6e799Ssimonb 467*e4a6e799Ssimonb s filename 468*e4a6e799Ssimonb Save the input to a file. This works only if the input is a 469*e4a6e799Ssimonb pipe, not an ordinary file. 470*e4a6e799Ssimonb 471*e4a6e799Ssimonb ^X When the "Waiting for data" message is displayed, such as while 472*e4a6e799Ssimonb in the F command, pressing ^X will stop [1mless [22mfrom waiting and 473*e4a6e799Ssimonb return to a prompt. This may cause [1mless [22mto think that the file 474*e4a6e799Ssimonb ends at the current position, so it may be necessary to use the 475*e4a6e799Ssimonb R or F command to see more data. The --intr option can be used 476*e4a6e799Ssimonb to specify a different character to use instead of ^X. This 477*e4a6e799Ssimonb command works only on systems that support the [1mpoll[22m(2) function. 478*e4a6e799Ssimonb On systems without [1mpoll[22m(2), the interrupt character (usually ^C) 479*e4a6e799Ssimonb can be used instead. 480*e4a6e799Ssimonb 481*e4a6e799Ssimonb[1mOPTIONS[0m 482*e4a6e799Ssimonb Command line options are described below. Most options may be changed 483*e4a6e799Ssimonb while [1mless [22mis running, via the "-" command. 484*e4a6e799Ssimonb 485*e4a6e799Ssimonb Some options may be given in one of two forms: either a dash followed 486*e4a6e799Ssimonb by a single letter, or two dashes followed by a long option name. A 487*e4a6e799Ssimonb long option name may be abbreviated as long as the abbreviation is un‐ 488*e4a6e799Ssimonb ambiguous. For example, --quit-at-eof may be abbreviated --quit, but 489*e4a6e799Ssimonb not --qui, since both --quit-at-eof and --quiet begin with --qui. Some 490*e4a6e799Ssimonb long option names are in uppercase, such as --QUIT-AT-EOF, as distinct 491*e4a6e799Ssimonb from --quit-at-eof. Such option names need only have their first let‐ 492*e4a6e799Ssimonb ter capitalized; the remainder of the name may be in either case. For 493*e4a6e799Ssimonb example, --Quit-at-eof is equivalent to --QUIT-AT-EOF. 494*e4a6e799Ssimonb 495*e4a6e799Ssimonb Options are also taken from the environment variable "LESS". For exam‐ 496*e4a6e799Ssimonb ple, to avoid typing "less -options ..." each time [1mless [22mis invoked, you 497*e4a6e799Ssimonb might tell [1mcsh[22m: 498*e4a6e799Ssimonb 499*e4a6e799Ssimonb setenv LESS "-options" 500*e4a6e799Ssimonb 501*e4a6e799Ssimonb or if you use [1msh[22m: 502*e4a6e799Ssimonb 503*e4a6e799Ssimonb LESS="-options"; export LESS 504*e4a6e799Ssimonb 505*e4a6e799Ssimonb On MS-DOS, you don't need the quotes, but you should replace any per‐ 506*e4a6e799Ssimonb cent signs in the options string by double percent signs. 507*e4a6e799Ssimonb 508*e4a6e799Ssimonb The environment variable is parsed before the command line, so command 509*e4a6e799Ssimonb line options override the LESS environment variable. If an option ap‐ 510*e4a6e799Ssimonb pears in the LESS variable, it can be reset to its default value on the 511*e4a6e799Ssimonb command line by beginning the command line option with "-+". 512*e4a6e799Ssimonb 513*e4a6e799Ssimonb Some options like -k or -D require a string to follow the option let‐ 514*e4a6e799Ssimonb ter. The string for that option is considered to end when a dollar 515*e4a6e799Ssimonb sign ($) is found. For example, you can set two -D options like this: 516*e4a6e799Ssimonb 517*e4a6e799Ssimonb LESS="Dn9.1$Ds4.1" 518*e4a6e799Ssimonb 519*e4a6e799Ssimonb If the --use-backslash option appears earlier in the options, then a 520*e4a6e799Ssimonb dollar sign or backslash may be included literally in an option string 521*e4a6e799Ssimonb by preceding it with a backslash. If the --use-backslash option is not 522*e4a6e799Ssimonb in effect, then backslashes are not treated specially, and there is no 523*e4a6e799Ssimonb way to include a dollar sign in the option string. 524*e4a6e799Ssimonb 525*e4a6e799Ssimonb -? or --help 526*e4a6e799Ssimonb This option displays a summary of the commands accepted by [1mless[0m 527*e4a6e799Ssimonb (the same as the h command). (Depending on how your shell in‐ 528*e4a6e799Ssimonb terprets the question mark, it may be necessary to quote the 529*e4a6e799Ssimonb question mark, thus: "-\?".) 530*e4a6e799Ssimonb 531*e4a6e799Ssimonb -a or --search-skip-screen 532*e4a6e799Ssimonb By default, forward searches start at the top of the displayed 533*e4a6e799Ssimonb screen and backwards searches start at the bottom of the dis‐ 534*e4a6e799Ssimonb played screen (except for repeated searches invoked by the n or 535*e4a6e799Ssimonb N commands, which start after or before the "target" line re‐ 536*e4a6e799Ssimonb spectively; see the -j option for more about the target line). 537*e4a6e799Ssimonb The -a option causes forward searches to instead start at the 538*e4a6e799Ssimonb bottom of the screen and backward searches to start at the top 539*e4a6e799Ssimonb of the screen, thus skipping all lines displayed on the screen. 540*e4a6e799Ssimonb 541*e4a6e799Ssimonb -A or --SEARCH-SKIP-SCREEN 542*e4a6e799Ssimonb Causes all forward searches (not just non-repeated searches) to 543*e4a6e799Ssimonb start just after the target line, and all backward searches to 544*e4a6e799Ssimonb start just before the target line. Thus, forward searches will 545*e4a6e799Ssimonb skip part of the displayed screen (from the first line up to and 546*e4a6e799Ssimonb including the target line). Similarly backwards searches will 547*e4a6e799Ssimonb skip the displayed screen from the last line up to and including 548*e4a6e799Ssimonb the target line. This was the default behavior in less versions 549*e4a6e799Ssimonb prior to 441. 550*e4a6e799Ssimonb 551*e4a6e799Ssimonb -b[4mn[24m or --buffers=[4mn[0m 552*e4a6e799Ssimonb Specifies the amount of buffer space [1mless [22mwill use for each 553*e4a6e799Ssimonb file, in units of kilobytes (1024 bytes). By default 64 KB of 554*e4a6e799Ssimonb buffer space is used for each file (unless the file is a pipe; 555*e4a6e799Ssimonb see the -B option). The -b option specifies instead that [4mn[0m 556*e4a6e799Ssimonb kilobytes of buffer space should be used for each file. If [4mn[24m is 557*e4a6e799Ssimonb -1, buffer space is unlimited; that is, the entire file can be 558*e4a6e799Ssimonb read into memory. 559*e4a6e799Ssimonb 560*e4a6e799Ssimonb -B or --auto-buffers 561*e4a6e799Ssimonb By default, when data is read from a pipe, buffers are allocated 562*e4a6e799Ssimonb automatically as needed. If a large amount of data is read from 563*e4a6e799Ssimonb the pipe, this can cause a large amount of memory to be allo‐ 564*e4a6e799Ssimonb cated. The -B option disables this automatic allocation of buf‐ 565*e4a6e799Ssimonb fers for pipes, so that only 64 KB (or the amount of space spec‐ 566*e4a6e799Ssimonb ified by the -b option) is used for the pipe. Warning: use of 567*e4a6e799Ssimonb -B can result in erroneous display, since only the most recently 568*e4a6e799Ssimonb viewed part of the piped data is kept in memory; any earlier 569*e4a6e799Ssimonb data is lost. Lost characters are displayed as question marks. 570*e4a6e799Ssimonb 571*e4a6e799Ssimonb -c or --clear-screen 572*e4a6e799Ssimonb Causes full screen repaints to be painted from the top line 573*e4a6e799Ssimonb down. By default, full screen repaints are done by scrolling 574*e4a6e799Ssimonb from the bottom of the screen. 575*e4a6e799Ssimonb 576*e4a6e799Ssimonb -C or --CLEAR-SCREEN 577*e4a6e799Ssimonb Same as -c, for compatibility with older versions of [1mless[22m. 578*e4a6e799Ssimonb 579*e4a6e799Ssimonb -d or --dumb 580*e4a6e799Ssimonb The -d option suppresses the error message normally displayed if 581*e4a6e799Ssimonb the terminal is dumb; that is, lacks some important capability, 582*e4a6e799Ssimonb such as the ability to clear the screen or scroll backward. The 583*e4a6e799Ssimonb -d option does not otherwise change the behavior of [1mless [22mon a 584*e4a6e799Ssimonb dumb terminal. 585*e4a6e799Ssimonb 586*e4a6e799Ssimonb -D[1mx[4m[22mcolor[24m or --color=[1mx[4m[22mcolor[0m 587*e4a6e799Ssimonb Changes the color of different parts of the displayed text. [1mx[0m 588*e4a6e799Ssimonb is a single character which selects the type of text whose color 589*e4a6e799Ssimonb is being set: 590*e4a6e799Ssimonb 591*e4a6e799Ssimonb B Binary characters. 592*e4a6e799Ssimonb 593*e4a6e799Ssimonb C Control characters. 594*e4a6e799Ssimonb 595*e4a6e799Ssimonb E Errors and informational messages. 596*e4a6e799Ssimonb 597*e4a6e799Ssimonb H Header lines and columns, set via the --header option. 598*e4a6e799Ssimonb 599*e4a6e799Ssimonb M Mark letters in the status column. 600*e4a6e799Ssimonb 601*e4a6e799Ssimonb N Line numbers enabled via the -N option. 602*e4a6e799Ssimonb 603*e4a6e799Ssimonb P Prompts. 604*e4a6e799Ssimonb 605*e4a6e799Ssimonb R The rscroll character. 606*e4a6e799Ssimonb 607*e4a6e799Ssimonb S Search results. 608*e4a6e799Ssimonb 609*e4a6e799Ssimonb 1-5 The text in a search result which matches the first 610*e4a6e799Ssimonb through fifth parenthesized sub-pattern. Sub-pattern 611*e4a6e799Ssimonb coloring works only if [1mless [22mis built with one of the reg‐ 612*e4a6e799Ssimonb ular expression libraries [1mposix[22m, [1mpcre[22m, or [1mpcre2[22m. 613*e4a6e799Ssimonb 614*e4a6e799Ssimonb W The highlight enabled via the -w option. 615*e4a6e799Ssimonb 616*e4a6e799Ssimonb d Bold text. 617*e4a6e799Ssimonb 618*e4a6e799Ssimonb k Blinking text. 619*e4a6e799Ssimonb 620*e4a6e799Ssimonb s Standout text. 621*e4a6e799Ssimonb 622*e4a6e799Ssimonb u Underlined text. 623*e4a6e799Ssimonb 624*e4a6e799Ssimonb The uppercase letters and digits can be used only when the 625*e4a6e799Ssimonb --use-color option is enabled. When text color is specified by 626*e4a6e799Ssimonb both an uppercase letter and a lowercase letter, the uppercase 627*e4a6e799Ssimonb letter takes precedence. For example, error messages are nor‐ 628*e4a6e799Ssimonb mally displayed as standout text. So if both "s" and "E" are 629*e4a6e799Ssimonb given a color, the "E" color applies to error messages, and the 630*e4a6e799Ssimonb "s" color applies to other standout text. The "d" and "u" let‐ 631*e4a6e799Ssimonb ters refer to bold and underline text formed by overstriking 632*e4a6e799Ssimonb with backspaces (see the -U option), not to text using ANSI es‐ 633*e4a6e799Ssimonb cape sequences with the -R option. 634*e4a6e799Ssimonb 635*e4a6e799Ssimonb A lowercase letter may be followed by a + to indicate that the 636*e4a6e799Ssimonb normal format change and the specified color should both be 637*e4a6e799Ssimonb used. For example, -Dug displays underlined text as green with‐ 638*e4a6e799Ssimonb out underlining; the green color has replaced the usual under‐ 639*e4a6e799Ssimonb line formatting. But -Du+g displays underlined text as both 640*e4a6e799Ssimonb green and in underlined format. 641*e4a6e799Ssimonb 642*e4a6e799Ssimonb [4mcolor[24m is either a 4-bit color string or an 8-bit color string: 643*e4a6e799Ssimonb 644*e4a6e799Ssimonb A 4-bit color string is zero, one or two characters, where the 645*e4a6e799Ssimonb first character specifies the foreground color and the second 646*e4a6e799Ssimonb specifies the background color as follows: 647*e4a6e799Ssimonb 648*e4a6e799Ssimonb b Blue 649*e4a6e799Ssimonb 650*e4a6e799Ssimonb c Cyan 651*e4a6e799Ssimonb 652*e4a6e799Ssimonb g Green 653*e4a6e799Ssimonb 654*e4a6e799Ssimonb k Black 655*e4a6e799Ssimonb 656*e4a6e799Ssimonb m Magenta 657*e4a6e799Ssimonb 658*e4a6e799Ssimonb r Red 659*e4a6e799Ssimonb 660*e4a6e799Ssimonb w White 661*e4a6e799Ssimonb 662*e4a6e799Ssimonb y Yellow 663*e4a6e799Ssimonb 664*e4a6e799Ssimonb The corresponding uppercase letter denotes a brighter shade of 665*e4a6e799Ssimonb the color. For example, -DNGk displays line numbers as bright 666*e4a6e799Ssimonb green text on a black background, and -DEbR displays error mes‐ 667*e4a6e799Ssimonb sages as blue text on a bright red background. If either char‐ 668*e4a6e799Ssimonb acter is a "-" or is omitted, the corresponding color is set to 669*e4a6e799Ssimonb that of normal text. 670*e4a6e799Ssimonb 671*e4a6e799Ssimonb An 8-bit color string is one or two decimal integers separated 672*e4a6e799Ssimonb by a dot, where the first integer specifies the foreground color 673*e4a6e799Ssimonb and the second specifies the background color. Each integer is 674*e4a6e799Ssimonb a value between 0 and 255 inclusive which selects a "CSI 38;5" 675*e4a6e799Ssimonb color value (see 676*e4a6e799Ssimonb https://en.wikipedia.org/wiki/ANSI_escape_code#SGR) If either 677*e4a6e799Ssimonb integer is a "-" or is omitted, the corresponding color is set 678*e4a6e799Ssimonb to that of normal text. On MS-DOS versions of [1mless[22m, 8-bit color 679*e4a6e799Ssimonb is not supported; instead, decimal values are interpreted as 680*e4a6e799Ssimonb 4-bit CHAR_INFO.Attributes values (see 681*e4a6e799Ssimonb https://docs.microsoft.com/en-us/windows/console/char-info-str). 682*e4a6e799Ssimonb 683*e4a6e799Ssimonb On MS-DOS only, the -Da option may be used to specify strict 684*e4a6e799Ssimonb parsing of ANSI color (SGR) sequences when the -R option is 685*e4a6e799Ssimonb used. Without this option, sequences that change text at‐ 686*e4a6e799Ssimonb tributes (bold, underline, etc.) may clear the text color. 687*e4a6e799Ssimonb 688*e4a6e799Ssimonb -e or --quit-at-eof 689*e4a6e799Ssimonb Causes [1mless [22mto automatically exit the second time it reaches 690*e4a6e799Ssimonb end-of-file. By default, the only way to exit [1mless [22mis via the 691*e4a6e799Ssimonb "q" command. 692*e4a6e799Ssimonb 693*e4a6e799Ssimonb -E or --QUIT-AT-EOF 694*e4a6e799Ssimonb Causes [1mless [22mto automatically exit the first time it reaches end- 695*e4a6e799Ssimonb of-file. 696*e4a6e799Ssimonb 697*e4a6e799Ssimonb -f or --force 698*e4a6e799Ssimonb Forces non-regular files to be opened. (A non-regular file is a 699*e4a6e799Ssimonb directory or a device special file.) Also suppresses the warn‐ 700*e4a6e799Ssimonb ing message when a binary file is opened. By default, [1mless [22mwill 701*e4a6e799Ssimonb refuse to open non-regular files. Note that some operating sys‐ 702*e4a6e799Ssimonb tems will not allow directories to be read, even if -f is set. 703*e4a6e799Ssimonb 704*e4a6e799Ssimonb -F or --quit-if-one-screen 705*e4a6e799Ssimonb Causes [1mless [22mto automatically exit if the entire file can be dis‐ 706*e4a6e799Ssimonb played on the first screen. 707*e4a6e799Ssimonb 708*e4a6e799Ssimonb -g or --hilite-search 709*e4a6e799Ssimonb Normally, [1mless [22mwill highlight ALL strings which match the last 710*e4a6e799Ssimonb search command. The -g option changes this behavior to high‐ 711*e4a6e799Ssimonb light only the particular string which was found by the last 712*e4a6e799Ssimonb search command. This can cause [1mless [22mto run somewhat faster than 713*e4a6e799Ssimonb the default. 714*e4a6e799Ssimonb 715*e4a6e799Ssimonb -G or --HILITE-SEARCH 716*e4a6e799Ssimonb The -G option suppresses all highlighting of strings found by 717*e4a6e799Ssimonb search commands. 718*e4a6e799Ssimonb 719*e4a6e799Ssimonb -h[4mn[24m or --max-back-scroll=[4mn[0m 720*e4a6e799Ssimonb Specifies a maximum number of lines to scroll backward. If it 721*e4a6e799Ssimonb is necessary to scroll backward more than [4mn[24m lines, the screen is 722*e4a6e799Ssimonb repainted in a forward direction instead. (If the terminal does 723*e4a6e799Ssimonb not have the ability to scroll backward, -h0 is implied.) 724*e4a6e799Ssimonb 725*e4a6e799Ssimonb -i or --ignore-case 726*e4a6e799Ssimonb Causes searches to ignore case; that is, uppercase and lowercase 727*e4a6e799Ssimonb are considered identical. This option is ignored if any upper‐ 728*e4a6e799Ssimonb case letters appear in the search pattern; in other words, if a 729*e4a6e799Ssimonb pattern contains uppercase letters, then that search does not 730*e4a6e799Ssimonb ignore case. 731*e4a6e799Ssimonb 732*e4a6e799Ssimonb -I or --IGNORE-CASE 733*e4a6e799Ssimonb Like -i, but searches ignore case even if the pattern contains 734*e4a6e799Ssimonb uppercase letters. 735*e4a6e799Ssimonb 736*e4a6e799Ssimonb -j[4mn[24m or --jump-target=[4mn[0m 737*e4a6e799Ssimonb Specifies a line on the screen where the "target" line is to be 738*e4a6e799Ssimonb positioned. The target line is the line specified by any com‐ 739*e4a6e799Ssimonb mand to search for a pattern, jump to a line number, jump to a 740*e4a6e799Ssimonb file percentage or jump to a tag. The screen line may be speci‐ 741*e4a6e799Ssimonb fied by a number: the top line on the screen is 1, the next is 742*e4a6e799Ssimonb 2, and so on. The number may be negative to specify a line rel‐ 743*e4a6e799Ssimonb ative to the bottom of the screen: the bottom line on the screen 744*e4a6e799Ssimonb is -1, the second to the bottom is -2, and so on. Alternately, 745*e4a6e799Ssimonb the screen line may be specified as a fraction of the height of 746*e4a6e799Ssimonb the screen, starting with a decimal point: .5 is in the middle 747*e4a6e799Ssimonb of the screen, .3 is three tenths down from the first line, and 748*e4a6e799Ssimonb so on. If the line is specified as a fraction, the actual line 749*e4a6e799Ssimonb number is recalculated if the terminal window is resized. If 750*e4a6e799Ssimonb any form of the -j option is used, repeated forward searches 751*e4a6e799Ssimonb (invoked with "n" or "N") begin at the line immediately after 752*e4a6e799Ssimonb the target line, and repeated backward searches begin at the 753*e4a6e799Ssimonb target line, unless changed by -a or -A. For example, if "-j4" 754*e4a6e799Ssimonb is used, the target line is the fourth line on the screen, so 755*e4a6e799Ssimonb forward searches begin at the fifth line on the screen. However 756*e4a6e799Ssimonb nonrepeated searches (invoked with "/" or "?") always begin at 757*e4a6e799Ssimonb the start or end of the current screen respectively. 758*e4a6e799Ssimonb 759*e4a6e799Ssimonb -J or --status-column 760*e4a6e799Ssimonb Displays a status column at the left edge of the screen. The 761*e4a6e799Ssimonb character displayed in the status column may be one of: 762*e4a6e799Ssimonb 763*e4a6e799Ssimonb > The line is chopped with the -S option, and the text that 764*e4a6e799Ssimonb is chopped off beyond the right edge of the screen con‐ 765*e4a6e799Ssimonb tains a match for the current search. 766*e4a6e799Ssimonb 767*e4a6e799Ssimonb < The line is horizontally shifted, and the text that is 768*e4a6e799Ssimonb shifted beyond the left side of the screen contains a 769*e4a6e799Ssimonb match for the current search. 770*e4a6e799Ssimonb 771*e4a6e799Ssimonb = The line is both chopped and shifted, and there are 772*e4a6e799Ssimonb matches beyond both sides of the screen. 773*e4a6e799Ssimonb 774*e4a6e799Ssimonb * There are matches in the visible part of the line but 775*e4a6e799Ssimonb none to the right or left of it. 776*e4a6e799Ssimonb 777*e4a6e799Ssimonb a-z, A-Z 778*e4a6e799Ssimonb The line has been marked with the corresponding letter 779*e4a6e799Ssimonb via the m command. 780*e4a6e799Ssimonb 781*e4a6e799Ssimonb -k[4mfilename[24m or --lesskey-file=[4mfilename[0m 782*e4a6e799Ssimonb Causes [1mless [22mto open and interpret the named file as a [1mlesskey[22m(1) 783*e4a6e799Ssimonb binary file. Multiple -k options may be specified. If the 784*e4a6e799Ssimonb LESSKEY or LESSKEY_SYSTEM environment variable is set, or if a 785*e4a6e799Ssimonb lesskey file is found in a standard place (see KEY BINDINGS), it 786*e4a6e799Ssimonb is also used as a [1mlesskey [22mfile. 787*e4a6e799Ssimonb 788*e4a6e799Ssimonb --lesskey-src=[4mfilename[0m 789*e4a6e799Ssimonb Causes [1mless [22mto open and interpret the named file as a [1mlesskey[22m(1) 790*e4a6e799Ssimonb source file. If the LESSKEYIN or LESSKEYIN_SYSTEM environment 791*e4a6e799Ssimonb variable is set, or if a lesskey source file is found in a stan‐ 792*e4a6e799Ssimonb dard place (see KEY BINDINGS), it is also used as a [4mlesskey[0m 793*e4a6e799Ssimonb [4msource[24m file. Prior to version 582, the [1mlesskey [22mprogram needed 794*e4a6e799Ssimonb to be run to convert a [4mlesskey[24m [4msource[24m file to a [4mlesskey[24m [4mbinary[0m 795*e4a6e799Ssimonb file for [1mless [22mto use. Newer versions of [1mless [22mread the [4mlesskey[0m 796*e4a6e799Ssimonb [4msource[24m file directly and ignore the binary file if the source 797*e4a6e799Ssimonb file exists. 798*e4a6e799Ssimonb 799*e4a6e799Ssimonb -K or --quit-on-intr 800*e4a6e799Ssimonb Causes [1mless [22mto exit immediately (with status 2) when an inter‐ 801*e4a6e799Ssimonb rupt character (usually ^C) is typed. Normally, an interrupt 802*e4a6e799Ssimonb character causes [1mless [22mto stop whatever it is doing and return to 803*e4a6e799Ssimonb its command prompt. Note that use of this option makes it im‐ 804*e4a6e799Ssimonb possible to return to the command prompt from the "F" command. 805*e4a6e799Ssimonb 806*e4a6e799Ssimonb -L or --no-lessopen 807*e4a6e799Ssimonb Ignore the LESSOPEN environment variable (see the INPUT PRE‐ 808*e4a6e799Ssimonb PROCESSOR section below). This option can be set from within 809*e4a6e799Ssimonb [1mless[22m, but it will apply only to files opened subsequently, not 810*e4a6e799Ssimonb to the file which is currently open. 811*e4a6e799Ssimonb 812*e4a6e799Ssimonb -m or --long-prompt 813*e4a6e799Ssimonb Causes [1mless [22mto prompt verbosely (like [1mmore[22m(1)), with the percent 814*e4a6e799Ssimonb into the file. By default, [1mless [22mprompts with a colon. 815*e4a6e799Ssimonb 816*e4a6e799Ssimonb -M or --LONG-PROMPT 817*e4a6e799Ssimonb Causes [1mless [22mto prompt even more verbosely than [1mmore[22m(1). 818*e4a6e799Ssimonb 819*e4a6e799Ssimonb -n or --line-numbers 820*e4a6e799Ssimonb Suppresses line numbers. The default (to use line numbers) may 821*e4a6e799Ssimonb cause [1mless [22mto run more slowly in some cases, especially with a 822*e4a6e799Ssimonb very large input file. Suppressing line numbers with the -n op‐ 823*e4a6e799Ssimonb tion will avoid this problem. Using line numbers means: the 824*e4a6e799Ssimonb line number will be displayed in the verbose prompt and in the = 825*e4a6e799Ssimonb command, and the v command will pass the current line number to 826*e4a6e799Ssimonb the editor (see also the discussion of LESSEDIT in PROMPTS be‐ 827*e4a6e799Ssimonb low). 828*e4a6e799Ssimonb 829*e4a6e799Ssimonb -N or --LINE-NUMBERS 830*e4a6e799Ssimonb Causes a line number to be displayed at the beginning of each 831*e4a6e799Ssimonb line in the display. 832*e4a6e799Ssimonb 833*e4a6e799Ssimonb -o[4mfilename[24m or --log-file=[4mfilename[0m 834*e4a6e799Ssimonb Causes [1mless [22mto copy its input to the named file as it is being 835*e4a6e799Ssimonb viewed. This applies only when the input file is a pipe, not an 836*e4a6e799Ssimonb ordinary file. If the file already exists, [1mless [22mwill ask for 837*e4a6e799Ssimonb confirmation before overwriting it. 838*e4a6e799Ssimonb 839*e4a6e799Ssimonb -O[4mfilename[24m or --LOG-FILE=[4mfilename[0m 840*e4a6e799Ssimonb The -O option is like -o, but it will overwrite an existing file 841*e4a6e799Ssimonb without asking for confirmation. 842*e4a6e799Ssimonb 843*e4a6e799Ssimonb If no log file has been specified, the -o and -O options can be 844*e4a6e799Ssimonb used from within [1mless [22mto specify a log file. Without a file 845*e4a6e799Ssimonb name, they will simply report the name of the log file. The "s" 846*e4a6e799Ssimonb command is equivalent to specifying -o from within [1mless[22m. 847*e4a6e799Ssimonb 848*e4a6e799Ssimonb -p[4mpattern[24m or --pattern=[4mpattern[0m 849*e4a6e799Ssimonb The -p option on the command line is equivalent to specifying 850*e4a6e799Ssimonb +/[4mpattern[24m; that is, it tells [1mless [22mto start at the first occur‐ 851*e4a6e799Ssimonb rence of [4mpattern[24m in the file. 852*e4a6e799Ssimonb 853*e4a6e799Ssimonb -P[4mprompt[24m or --prompt=[4mprompt[0m 854*e4a6e799Ssimonb Provides a way to tailor the three prompt styles to your own 855*e4a6e799Ssimonb preference. This option would normally be put in the LESS envi‐ 856*e4a6e799Ssimonb ronment variable, rather than being typed in with each [1mless [22mcom‐ 857*e4a6e799Ssimonb mand. Such an option must either be the last option in the LESS 858*e4a6e799Ssimonb variable, or be terminated by a dollar sign. 859*e4a6e799Ssimonb -Ps followed by a string changes the default (short) prompt to 860*e4a6e799Ssimonb that string. 861*e4a6e799Ssimonb -Pm changes the medium (-m) prompt. 862*e4a6e799Ssimonb -PM changes the long (-M) prompt. 863*e4a6e799Ssimonb -Ph changes the prompt for the help screen. 864*e4a6e799Ssimonb -P= changes the message printed by the = command. 865*e4a6e799Ssimonb -Pw changes the message printed while waiting for data (in the 866*e4a6e799Ssimonb "F" command). 867*e4a6e799Ssimonb 868*e4a6e799Ssimonb All prompt strings consist of a sequence of letters and special 869*e4a6e799Ssimonb escape sequences. See the section on PROMPTS for more details. 870*e4a6e799Ssimonb 871*e4a6e799Ssimonb -q or --quiet or --silent 872*e4a6e799Ssimonb Causes moderately "quiet" operation: the terminal bell is not 873*e4a6e799Ssimonb rung if an attempt is made to scroll past the end of the file or 874*e4a6e799Ssimonb before the beginning of the file. If the terminal has a "visual 875*e4a6e799Ssimonb bell", it is used instead. The bell will be rung on certain 876*e4a6e799Ssimonb other errors, such as typing an invalid character. The default 877*e4a6e799Ssimonb is to ring the terminal bell in all such cases. 878*e4a6e799Ssimonb 879*e4a6e799Ssimonb -Q or --QUIET or --SILENT 880*e4a6e799Ssimonb Causes totally "quiet" operation: the terminal bell is never 881*e4a6e799Ssimonb rung. If the terminal has a "visual bell", it is used in all 882*e4a6e799Ssimonb cases where the terminal bell would have been rung. 883*e4a6e799Ssimonb 884*e4a6e799Ssimonb -r or --raw-control-chars 885*e4a6e799Ssimonb Causes "raw" control characters to be displayed. The default is 886*e4a6e799Ssimonb to display control characters using the caret notation; for ex‐ 887*e4a6e799Ssimonb ample, a control-A (octal 001) is displayed as "^A" (with some 888*e4a6e799Ssimonb exceptions as described under the -U option). Warning: when the 889*e4a6e799Ssimonb -r option is used, [1mless [22mcannot keep track of the actual appear‐ 890*e4a6e799Ssimonb ance of the screen (since this depends on how the screen re‐ 891*e4a6e799Ssimonb sponds to each type of control character). Thus, various dis‐ 892*e4a6e799Ssimonb play problems may result, such as long lines being split in the 893*e4a6e799Ssimonb wrong place. 894*e4a6e799Ssimonb 895*e4a6e799Ssimonb USE OF THE -r OPTION IS NOT RECOMMENDED. 896*e4a6e799Ssimonb 897*e4a6e799Ssimonb -R or --RAW-CONTROL-CHARS 898*e4a6e799Ssimonb Like -r, but only ANSI "color" escape sequences and OSC 8 hyper‐ 899*e4a6e799Ssimonb link sequences are output in "raw" form. Unlike -r, the screen 900*e4a6e799Ssimonb appearance is maintained correctly, provided that there are no 901*e4a6e799Ssimonb escape sequences in the file other than these types of escape 902*e4a6e799Ssimonb sequences. Color escape sequences are only supported when the 903*e4a6e799Ssimonb color is changed within one line, not across lines. In other 904*e4a6e799Ssimonb words, the beginning of each line is assumed to be normal (non- 905*e4a6e799Ssimonb colored), regardless of any escape sequences in previous lines. 906*e4a6e799Ssimonb For the purpose of keeping track of screen appearance, these es‐ 907*e4a6e799Ssimonb cape sequences are assumed to not move the cursor. 908*e4a6e799Ssimonb 909*e4a6e799Ssimonb OSC 8 hyperlinks are sequences of the form: 910*e4a6e799Ssimonb 911*e4a6e799Ssimonb ESC ] 8 ; ... \7 912*e4a6e799Ssimonb 913*e4a6e799Ssimonb The terminating sequence may be either a BEL character (\7) or 914*e4a6e799Ssimonb the two-character sequence "ESC \". 915*e4a6e799Ssimonb 916*e4a6e799Ssimonb ANSI color escape sequences are sequences of the form: 917*e4a6e799Ssimonb 918*e4a6e799Ssimonb ESC [ ... m 919*e4a6e799Ssimonb 920*e4a6e799Ssimonb where the "..." is zero or more color specification characters. 921*e4a6e799Ssimonb You can make [1mless [22mthink that characters other than "m" can end 922*e4a6e799Ssimonb ANSI color escape sequences by setting the environment variable 923*e4a6e799Ssimonb LESSANSIENDCHARS to the list of characters which can end a color 924*e4a6e799Ssimonb escape sequence. And you can make [1mless [22mthink that characters 925*e4a6e799Ssimonb other than the standard ones may appear between the ESC and the 926*e4a6e799Ssimonb m by setting the environment variable LESSANSIMIDCHARS to the 927*e4a6e799Ssimonb list of characters which can appear. 928*e4a6e799Ssimonb 929*e4a6e799Ssimonb -s or --squeeze-blank-lines 930*e4a6e799Ssimonb Causes consecutive blank lines to be squeezed into a single 931*e4a6e799Ssimonb blank line. This is useful when viewing [1mnroff [22moutput. 932*e4a6e799Ssimonb 933*e4a6e799Ssimonb -S or --chop-long-lines 934*e4a6e799Ssimonb Causes lines longer than the screen width to be chopped (trun‐ 935*e4a6e799Ssimonb cated) rather than wrapped. That is, the portion of a long line 936*e4a6e799Ssimonb that does not fit in the screen width is not displayed until you 937*e4a6e799Ssimonb press RIGHT-ARROW. The default is to wrap long lines; that is, 938*e4a6e799Ssimonb display the remainder on the next line. See also the --wordwrap 939*e4a6e799Ssimonb option. 940*e4a6e799Ssimonb 941*e4a6e799Ssimonb -t[4mtag[24m or --tag=[4mtag[0m 942*e4a6e799Ssimonb The -t option, followed immediately by a TAG, will edit the file 943*e4a6e799Ssimonb containing that tag. For this to work, tag information must be 944*e4a6e799Ssimonb available; for example, there may be a file in the current di‐ 945*e4a6e799Ssimonb rectory called "tags", which was previously built by [1mctags[22m(1) or 946*e4a6e799Ssimonb an equivalent command. If the environment variable LESSGLOBALT‐ 947*e4a6e799Ssimonb AGS is set, it is taken to be the name of a command compatible 948*e4a6e799Ssimonb with [1mglobal[22m(1), and that command is executed to find the tag. 949*e4a6e799Ssimonb (See http://www.gnu.org/software/global/global.html). The -t 950*e4a6e799Ssimonb option may also be specified from within [1mless [22m(using the - com‐ 951*e4a6e799Ssimonb mand) as a way of examining a new file. The command ":t" is 952*e4a6e799Ssimonb equivalent to specifying -t from within [1mless[22m. 953*e4a6e799Ssimonb 954*e4a6e799Ssimonb -T[4mtagsfile[24m or --tag-file=[4mtagsfile[0m 955*e4a6e799Ssimonb Specifies a tags file to be used instead of "tags". 956*e4a6e799Ssimonb 957*e4a6e799Ssimonb -u or --underline-special 958*e4a6e799Ssimonb Causes backspaces and carriage returns to be treated as print‐ 959*e4a6e799Ssimonb able characters; that is, they are sent to the terminal when 960*e4a6e799Ssimonb they appear in the input. 961*e4a6e799Ssimonb 962*e4a6e799Ssimonb -U or --UNDERLINE-SPECIAL 963*e4a6e799Ssimonb Causes backspaces, tabs, carriage returns and "formatting char‐ 964*e4a6e799Ssimonb acters" (as defined by Unicode) to be treated as control charac‐ 965*e4a6e799Ssimonb ters; that is, they are handled as specified by the -r option. 966*e4a6e799Ssimonb 967*e4a6e799Ssimonb By default, if neither -u nor -U is given, backspaces which ap‐ 968*e4a6e799Ssimonb pear adjacent to an underscore character are treated specially: 969*e4a6e799Ssimonb the underlined text is displayed using the terminal's hardware 970*e4a6e799Ssimonb underlining capability. Also, backspaces which appear between 971*e4a6e799Ssimonb two identical characters are treated specially: the overstruck 972*e4a6e799Ssimonb text is printed using the terminal's hardware boldface capabili‐ 973*e4a6e799Ssimonb ty. Other backspaces are deleted, along with the preceding 974*e4a6e799Ssimonb character. Carriage returns immediately followed by a newline 975*e4a6e799Ssimonb are deleted. Other carriage returns are handled as specified by 976*e4a6e799Ssimonb the -r option. Unicode formatting characters, such as the Byte 977*e4a6e799Ssimonb Order Mark, are sent to the terminal. Text which is overstruck 978*e4a6e799Ssimonb or underlined can be searched for if neither -u nor -U is in ef‐ 979*e4a6e799Ssimonb fect. 980*e4a6e799Ssimonb 981*e4a6e799Ssimonb See also the --proc-backspace, --proc-tab, and --proc-return op‐ 982*e4a6e799Ssimonb tions. 983*e4a6e799Ssimonb 984*e4a6e799Ssimonb -V or --version 985*e4a6e799Ssimonb Displays the version number of [1mless[22m. 986*e4a6e799Ssimonb 987*e4a6e799Ssimonb -w or --hilite-unread 988*e4a6e799Ssimonb Temporarily highlights the first "new" line after a forward 989*e4a6e799Ssimonb movement of a full page. The first "new" line is the line imme‐ 990*e4a6e799Ssimonb diately following the line previously at the bottom of the 991*e4a6e799Ssimonb screen. Also highlights the target line after a g or p command. 992*e4a6e799Ssimonb The highlight is removed at the next command which causes move‐ 993*e4a6e799Ssimonb ment. If the --status-line option is in effect, the entire line 994*e4a6e799Ssimonb (the width of the screen) is highlighted. Otherwise, only the 995*e4a6e799Ssimonb text in the line is highlighted, unless the -J option is in ef‐ 996*e4a6e799Ssimonb fect, in which case only the status column is highlighted. 997*e4a6e799Ssimonb 998*e4a6e799Ssimonb -W or --HILITE-UNREAD 999*e4a6e799Ssimonb Like -w, but temporarily highlights the first new line after any 1000*e4a6e799Ssimonb forward movement command larger than one line. 1001*e4a6e799Ssimonb 1002*e4a6e799Ssimonb -x[4mn[24m,... or --tabs=[4mn[24m,... 1003*e4a6e799Ssimonb Sets tab stops. If only one [4mn[24m is specified, tab stops are set 1004*e4a6e799Ssimonb at multiples of [4mn[24m. If multiple values separated by commas are 1005*e4a6e799Ssimonb specified, tab stops are set at those positions, and then con‐ 1006*e4a6e799Ssimonb tinue with the same spacing as the last two. For example, 1007*e4a6e799Ssimonb "-x9,17" will set tabs at positions 9, 17, 25, 33, etc. The de‐ 1008*e4a6e799Ssimonb fault for [4mn[24m is 8. 1009*e4a6e799Ssimonb 1010*e4a6e799Ssimonb -X or --no-init 1011*e4a6e799Ssimonb Disables sending the termcap initialization and deinitialization 1012*e4a6e799Ssimonb strings to the terminal. This is sometimes desirable if the 1013*e4a6e799Ssimonb deinitialization string does something unnecessary, like clear‐ 1014*e4a6e799Ssimonb ing the screen. 1015*e4a6e799Ssimonb 1016*e4a6e799Ssimonb -y[4mn[24m or --max-forw-scroll=[4mn[0m 1017*e4a6e799Ssimonb Specifies a maximum number of lines to scroll forward. If it is 1018*e4a6e799Ssimonb necessary to scroll forward more than [4mn[24m lines, the screen is re‐ 1019*e4a6e799Ssimonb painted instead. The -c or -C option may be used to repaint 1020*e4a6e799Ssimonb from the top of the screen if desired. By default, any forward 1021*e4a6e799Ssimonb movement causes scrolling. 1022*e4a6e799Ssimonb 1023*e4a6e799Ssimonb -z[4mn[24m or --window=[4mn[24m or -[4mn[0m 1024*e4a6e799Ssimonb Changes the default scrolling window size to [4mn[24m lines. The de‐ 1025*e4a6e799Ssimonb fault is one screenful. The z and w commands can also be used 1026*e4a6e799Ssimonb to change the window size. The "z" may be omitted for compati‐ 1027*e4a6e799Ssimonb bility with some versions of [1mmore[22m(1). If the number [4mn[24m is nega‐ 1028*e4a6e799Ssimonb tive, it indicates [4mn[24m lines less than the current screen size. 1029*e4a6e799Ssimonb For example, if the screen is 24 lines, [4m-z-4[24m sets the scrolling 1030*e4a6e799Ssimonb window to 20 lines. If the screen is resized to 40 lines, the 1031*e4a6e799Ssimonb scrolling window automatically changes to 36 lines. 1032*e4a6e799Ssimonb 1033*e4a6e799Ssimonb -"[4mcc[24m or --quotes=[4mcc[0m 1034*e4a6e799Ssimonb Changes the filename quoting character. This may be necessary 1035*e4a6e799Ssimonb if you are trying to name a file which contains both spaces and 1036*e4a6e799Ssimonb quote characters. Followed by a single character, this changes 1037*e4a6e799Ssimonb the quote character to that character. Filenames containing a 1038*e4a6e799Ssimonb space should then be surrounded by that character rather than by 1039*e4a6e799Ssimonb double quotes. Followed by two characters, changes the open 1040*e4a6e799Ssimonb quote to the first character, and the close quote to the second 1041*e4a6e799Ssimonb character. Filenames containing a space should then be preceded 1042*e4a6e799Ssimonb by the open quote character and followed by the close quote 1043*e4a6e799Ssimonb character. Note that even after the quote characters are 1044*e4a6e799Ssimonb changed, this option remains -" (a dash followed by a double 1045*e4a6e799Ssimonb quote). 1046*e4a6e799Ssimonb 1047*e4a6e799Ssimonb -~ or --tilde 1048*e4a6e799Ssimonb Normally lines after end of file are displayed as a single tilde 1049*e4a6e799Ssimonb (~). This option causes lines after end of file to be displayed 1050*e4a6e799Ssimonb as blank lines. 1051*e4a6e799Ssimonb 1052*e4a6e799Ssimonb -# or --shift 1053*e4a6e799Ssimonb Specifies the default number of positions to scroll horizontally 1054*e4a6e799Ssimonb in the RIGHTARROW and LEFTARROW commands. If the number speci‐ 1055*e4a6e799Ssimonb fied is zero, it sets the default number of positions to one 1056*e4a6e799Ssimonb half of the screen width. Alternately, the number may be speci‐ 1057*e4a6e799Ssimonb fied as a fraction of the width of the screen, starting with a 1058*e4a6e799Ssimonb decimal point: .5 is half of the screen width, .3 is three 1059*e4a6e799Ssimonb tenths of the screen width, and so on. If the number is speci‐ 1060*e4a6e799Ssimonb fied as a fraction, the actual number of scroll positions is re‐ 1061*e4a6e799Ssimonb calculated if the terminal window is resized. 1062*e4a6e799Ssimonb 1063*e4a6e799Ssimonb --exit-follow-on-close 1064*e4a6e799Ssimonb When using the "F" command on a pipe, [1mless [22mwill automatically 1065*e4a6e799Ssimonb stop waiting for more data when the input side of the pipe is 1066*e4a6e799Ssimonb closed. 1067*e4a6e799Ssimonb 1068*e4a6e799Ssimonb --file-size 1069*e4a6e799Ssimonb If --file-size is specified, [1mless [22mwill determine the size of the 1070*e4a6e799Ssimonb file immediately after opening the file. Then the "=" command 1071*e4a6e799Ssimonb will display the number of lines in the file. Normally this is 1072*e4a6e799Ssimonb not done, because it can be slow if the input file is non-seek‐ 1073*e4a6e799Ssimonb able (such as a pipe) and is large. 1074*e4a6e799Ssimonb 1075*e4a6e799Ssimonb --follow-name 1076*e4a6e799Ssimonb Normally, if the input file is renamed while an F command is ex‐ 1077*e4a6e799Ssimonb ecuting, [1mless [22mwill continue to display the contents of the orig‐ 1078*e4a6e799Ssimonb inal file despite its name change. If --follow-name is speci‐ 1079*e4a6e799Ssimonb fied, during an F command [1mless [22mwill periodically attempt to re‐ 1080*e4a6e799Ssimonb open the file by name. If the reopen succeeds and the file is a 1081*e4a6e799Ssimonb different file from the original (which means that a new file 1082*e4a6e799Ssimonb has been created with the same name as the original (now re‐ 1083*e4a6e799Ssimonb named) file), [1mless [22mwill display the contents of that new file. 1084*e4a6e799Ssimonb 1085*e4a6e799Ssimonb --header=[4mN[,M][0m 1086*e4a6e799Ssimonb Sets the number of header lines and columns displayed on the 1087*e4a6e799Ssimonb screen. The value may be of the form "N,M" where N and M are 1088*e4a6e799Ssimonb integers, to set the header lines to N and the header columns to 1089*e4a6e799Ssimonb M, or it may be a single integer "N" which sets the header lines 1090*e4a6e799Ssimonb to N and the header columns to zero, or it may be ",M" which 1091*e4a6e799Ssimonb sets the header columns to M and the header lines to zero. When 1092*e4a6e799Ssimonb N is nonzero, the first N lines at the top of the screen are re‐ 1093*e4a6e799Ssimonb placed with the first N lines of the file, regardless of what 1094*e4a6e799Ssimonb part of the file are being viewed. When M is nonzero, the char‐ 1095*e4a6e799Ssimonb acters displayed at the beginning of each line are replaced with 1096*e4a6e799Ssimonb the first M characters of the line, even if the rest of the line 1097*e4a6e799Ssimonb is scrolled horizontally. If either N or M is zero, [1mless [22mstops 1098*e4a6e799Ssimonb displaying header lines or columns, respectively. (Note that it 1099*e4a6e799Ssimonb may be necessary to change the setting of the -j option to en‐ 1100*e4a6e799Ssimonb sure that the target line is not obscured by the header 1101*e4a6e799Ssimonb line(s).) 1102*e4a6e799Ssimonb 1103*e4a6e799Ssimonb --incsearch 1104*e4a6e799Ssimonb Subsequent search commands will be "incremental"; that is, [1mless[0m 1105*e4a6e799Ssimonb will advance to the next line containing the search pattern as 1106*e4a6e799Ssimonb each character of the pattern is typed in. 1107*e4a6e799Ssimonb 1108*e4a6e799Ssimonb --intr=[4mc[0m 1109*e4a6e799Ssimonb Use the character [4mc[24m instead of ^X to interrupt a read when the 1110*e4a6e799Ssimonb "Waiting for data" message is displayed. [4mc[24m must be an ASCII 1111*e4a6e799Ssimonb character; that is, one with a value between 1 and 127 inclu‐ 1112*e4a6e799Ssimonb sive. A caret followed by a single character can be used to 1113*e4a6e799Ssimonb specify a control character. 1114*e4a6e799Ssimonb 1115*e4a6e799Ssimonb --line-num-width=[4mn[0m 1116*e4a6e799Ssimonb Sets the minimum width of the line number field when the -N op‐ 1117*e4a6e799Ssimonb tion is in effect to [4mn[24m characters. The default is 7. 1118*e4a6e799Ssimonb 1119*e4a6e799Ssimonb --modelines=[4mn[0m 1120*e4a6e799Ssimonb Before displaying a file, [1mless [22mwill read the first [4mn[24m lines to 1121*e4a6e799Ssimonb try to find a vim-compatible [4mmodeline[24m. If [4mn[24m is zero, [1mless [22mdoes 1122*e4a6e799Ssimonb not try to find modelines. By using a modeline, the file itself 1123*e4a6e799Ssimonb can specify the tab stops that should be used when viewing it. 1124*e4a6e799Ssimonb 1125*e4a6e799Ssimonb A modeline contains, anywhere in the line, a program name ("vi", 1126*e4a6e799Ssimonb "vim", "ex", or "less"), followed by a colon, possibly followed 1127*e4a6e799Ssimonb by the word "set", and finally followed by zero or more option 1128*e4a6e799Ssimonb settings. If the word "set" is used, option settings are sepa‐ 1129*e4a6e799Ssimonb rated by spaces, and end at the first colon. If the word "set" 1130*e4a6e799Ssimonb is not used, option settings may be separated by either spaces 1131*e4a6e799Ssimonb or colons. The word "set" is required if the program name is 1132*e4a6e799Ssimonb "less" but optional if any of the other three names are used. 1133*e4a6e799Ssimonb If any option setting is of the form "tabstop=[4mn[24m" or "ts=[4mn[24m", then 1134*e4a6e799Ssimonb tab stops are automatically set as if --tabs=[4mn[24m had been given. 1135*e4a6e799Ssimonb See the --tabs description for acceptable values of [4mn[24m. 1136*e4a6e799Ssimonb 1137*e4a6e799Ssimonb --mouse 1138*e4a6e799Ssimonb Enables mouse input: scrolling the mouse wheel down moves for‐ 1139*e4a6e799Ssimonb ward in the file, scrolling the mouse wheel up moves backwards 1140*e4a6e799Ssimonb in the file, and clicking the mouse sets the "#" mark to the 1141*e4a6e799Ssimonb line where the mouse is clicked. The number of lines to scroll 1142*e4a6e799Ssimonb when the wheel is moved can be set by the --wheel-lines option. 1143*e4a6e799Ssimonb Mouse input works only on terminals which support X11 mouse re‐ 1144*e4a6e799Ssimonb porting, and on the Windows version of [1mless[22m. 1145*e4a6e799Ssimonb 1146*e4a6e799Ssimonb --MOUSE 1147*e4a6e799Ssimonb Like --mouse, except the direction scrolled on mouse wheel move‐ 1148*e4a6e799Ssimonb ment is reversed. 1149*e4a6e799Ssimonb 1150*e4a6e799Ssimonb --no-keypad 1151*e4a6e799Ssimonb Disables sending the keypad initialization and deinitialization 1152*e4a6e799Ssimonb strings to the terminal. This is sometimes useful if the keypad 1153*e4a6e799Ssimonb strings make the numeric keypad behave in an undesirable manner. 1154*e4a6e799Ssimonb 1155*e4a6e799Ssimonb --no-histdups 1156*e4a6e799Ssimonb This option changes the behavior so that if a search string or 1157*e4a6e799Ssimonb file name is typed in, and the same string is already in the 1158*e4a6e799Ssimonb history list, the existing copy is removed from the history list 1159*e4a6e799Ssimonb before the new one is added. Thus, a given string will appear 1160*e4a6e799Ssimonb only once in the history list. Normally, a string may appear 1161*e4a6e799Ssimonb multiple times. 1162*e4a6e799Ssimonb 1163*e4a6e799Ssimonb --no-number-headers 1164*e4a6e799Ssimonb Header lines (defined via the --header option) are not assigned 1165*e4a6e799Ssimonb line numbers. Line number 1 is assigned to the first line after 1166*e4a6e799Ssimonb any header lines. 1167*e4a6e799Ssimonb 1168*e4a6e799Ssimonb --no-search-headers 1169*e4a6e799Ssimonb Searches do not include header lines or header columns. 1170*e4a6e799Ssimonb 1171*e4a6e799Ssimonb --no-vbell 1172*e4a6e799Ssimonb Disables the terminal's visual bell. 1173*e4a6e799Ssimonb 1174*e4a6e799Ssimonb --proc-backspace 1175*e4a6e799Ssimonb If set, backspaces are handled as if neither the -u option nor 1176*e4a6e799Ssimonb the -U option were set. That is, a backspace adjacent to an un‐ 1177*e4a6e799Ssimonb derscore causes text to be displayed in underline mode, and a 1178*e4a6e799Ssimonb backspace between identical characters cause text to be dis‐ 1179*e4a6e799Ssimonb played in boldface mode. This option overrides the -u and -U 1180*e4a6e799Ssimonb options, so that display of backspaces can be controlled sepa‐ 1181*e4a6e799Ssimonb rate from tabs and carriage returns. If not set, backspace dis‐ 1182*e4a6e799Ssimonb play is controlled by the -u and -U options. 1183*e4a6e799Ssimonb 1184*e4a6e799Ssimonb --PROC-BACKSPACE 1185*e4a6e799Ssimonb If set, backspaces are handled as if the -U option were set; 1186*e4a6e799Ssimonb that is backspaces are treated as control characters. 1187*e4a6e799Ssimonb 1188*e4a6e799Ssimonb --proc-return 1189*e4a6e799Ssimonb If set, carriage returns are handled as if neither the -u option 1190*e4a6e799Ssimonb nor the -U option were set. That is, a carriage return immedi‐ 1191*e4a6e799Ssimonb ately before a newline is deleted. This option overrides the -u 1192*e4a6e799Ssimonb and -U options, so that display of carriage returns can be con‐ 1193*e4a6e799Ssimonb trolled separate from that of backspaces and tabs. If not set, 1194*e4a6e799Ssimonb carriage return display is controlled by the -u and -U options. 1195*e4a6e799Ssimonb 1196*e4a6e799Ssimonb --PROC-RETURN 1197*e4a6e799Ssimonb If set, carriage returns are handled as if the -U option were 1198*e4a6e799Ssimonb set; that is carriage returns are treated as control characters. 1199*e4a6e799Ssimonb 1200*e4a6e799Ssimonb --proc-tab 1201*e4a6e799Ssimonb If set, tabs are handled as if the -U option were not set. That 1202*e4a6e799Ssimonb is, tabs are expanded to spaces. This option overrides the -U 1203*e4a6e799Ssimonb option, so that display of tabs can be controlled separate from 1204*e4a6e799Ssimonb that of backspaces and carriage returns. If not set, tab dis‐ 1205*e4a6e799Ssimonb play is controlled by the -U options. 1206*e4a6e799Ssimonb 1207*e4a6e799Ssimonb --PROC-TAB 1208*e4a6e799Ssimonb If set, tabs are handled as if the -U option were set; that is 1209*e4a6e799Ssimonb tabs are treated as control characters. 1210*e4a6e799Ssimonb 1211*e4a6e799Ssimonb --redraw-on-quit 1212*e4a6e799Ssimonb When quitting, after sending the terminal deinitialization 1213*e4a6e799Ssimonb string, redraws the entire last screen. On terminals whose ter‐ 1214*e4a6e799Ssimonb minal deinitialization string causes the terminal to switch from 1215*e4a6e799Ssimonb an alternate screen, this makes the last screenful of the cur‐ 1216*e4a6e799Ssimonb rent file remain visible after [1mless [22mhas quit. 1217*e4a6e799Ssimonb 1218*e4a6e799Ssimonb --rscroll=[4mc[0m 1219*e4a6e799Ssimonb This option changes the character used to mark truncated lines. 1220*e4a6e799Ssimonb It may begin with a two-character attribute indicator like LESS‐ 1221*e4a6e799Ssimonb BINFMT does. If there is no attribute indicator, standout is 1222*e4a6e799Ssimonb used. If set to "-", truncated lines are not marked. 1223*e4a6e799Ssimonb 1224*e4a6e799Ssimonb --save-marks 1225*e4a6e799Ssimonb Save marks in the history file, so marks are retained across 1226*e4a6e799Ssimonb different invocations of [1mless[22m. 1227*e4a6e799Ssimonb 1228*e4a6e799Ssimonb --search-options=[4m...[0m 1229*e4a6e799Ssimonb Sets default search modifiers. The value is a string of one or 1230*e4a6e799Ssimonb more of the characters E, F, K, N, R or W. Setting any of these 1231*e4a6e799Ssimonb has the same effect as typing that control character at the be‐ 1232*e4a6e799Ssimonb ginning of every search pattern. For example, setting --search- 1233*e4a6e799Ssimonb options=W is the same as typing ^W at the beginning of every 1234*e4a6e799Ssimonb pattern. The value may also contain a digit between 1 and 5, 1235*e4a6e799Ssimonb which has the same effect as typing ^S followed by that digit at 1236*e4a6e799Ssimonb the beginning of every search pattern. The value "-" disables 1237*e4a6e799Ssimonb all default search modifiers. 1238*e4a6e799Ssimonb 1239*e4a6e799Ssimonb --show-preproc-errors 1240*e4a6e799Ssimonb If a preprocessor produces data, then exits with a non-zero exit 1241*e4a6e799Ssimonb code, [1mless [22mwill display a warning. 1242*e4a6e799Ssimonb 1243*e4a6e799Ssimonb --status-col-width=[4mn[0m 1244*e4a6e799Ssimonb Sets the width of the status column when the -J option is in ef‐ 1245*e4a6e799Ssimonb fect. The default is 2 characters. 1246*e4a6e799Ssimonb 1247*e4a6e799Ssimonb --status-line 1248*e4a6e799Ssimonb If a line is marked, the entire line (rather than just the sta‐ 1249*e4a6e799Ssimonb tus column) is highlighted. Also lines highlighted due to the 1250*e4a6e799Ssimonb -w option will have the entire line highlighted. If --use-color 1251*e4a6e799Ssimonb is set, the line is colored rather than highlighted. 1252*e4a6e799Ssimonb 1253*e4a6e799Ssimonb --use-backslash 1254*e4a6e799Ssimonb This option changes the interpretations of options which follow 1255*e4a6e799Ssimonb this one. After the --use-backslash option, any backslash in an 1256*e4a6e799Ssimonb option string is removed and the following character is taken 1257*e4a6e799Ssimonb literally. This allows a dollar sign to be included in option 1258*e4a6e799Ssimonb strings. 1259*e4a6e799Ssimonb 1260*e4a6e799Ssimonb --use-color 1261*e4a6e799Ssimonb Enables colored text in various places. The -D option can be 1262*e4a6e799Ssimonb used to change the colors. Colored text works only if the ter‐ 1263*e4a6e799Ssimonb minal supports ANSI color escape sequences (as defined in EC‐ 1264*e4a6e799Ssimonb MA-48 SGR; see 1265*e4a6e799Ssimonb https://www.ecma-international.org/publications-and- 1266*e4a6e799Ssimonb standards/standards/ecma-48). 1267*e4a6e799Ssimonb 1268*e4a6e799Ssimonb --wheel-lines=[4mn[0m 1269*e4a6e799Ssimonb Set the number of lines to scroll when the mouse wheel is 1270*e4a6e799Ssimonb scrolled and the --mouse or --MOUSE option is in effect. The 1271*e4a6e799Ssimonb default is 1 line. 1272*e4a6e799Ssimonb 1273*e4a6e799Ssimonb --wordwrap 1274*e4a6e799Ssimonb When the -S option is not in use, wrap each line at a space or 1275*e4a6e799Ssimonb tab if possible, so that a word is not split between two lines. 1276*e4a6e799Ssimonb The default is to wrap at any character. 1277*e4a6e799Ssimonb 1278*e4a6e799Ssimonb -- A command line argument of "--" marks the end of option argu‐ 1279*e4a6e799Ssimonb ments. Any arguments following this are interpreted as file‐ 1280*e4a6e799Ssimonb names. This can be useful when viewing a file whose name begins 1281*e4a6e799Ssimonb with a "-" or "+". 1282*e4a6e799Ssimonb 1283*e4a6e799Ssimonb + If a command line option begins with [1m+[22m, the remainder of that 1284*e4a6e799Ssimonb option is taken to be an initial command to [1mless[22m. For example, 1285*e4a6e799Ssimonb +G tells [1mless [22mto start at the end of the file rather than the 1286*e4a6e799Ssimonb beginning, and +/xyz tells it to start at the first occurrence 1287*e4a6e799Ssimonb of "xyz" in the file. As a special case, +<number> acts like 1288*e4a6e799Ssimonb +<number>g; that is, it starts the display at the specified line 1289*e4a6e799Ssimonb number (however, see the caveat under the "g" command above). 1290*e4a6e799Ssimonb If the option starts with ++, the initial command applies to ev‐ 1291*e4a6e799Ssimonb ery file being viewed, not just the first one. The + command 1292*e4a6e799Ssimonb described previously may also be used to set (or change) an ini‐ 1293*e4a6e799Ssimonb tial command for every file. 1294*e4a6e799Ssimonb 1295*e4a6e799Ssimonb[1mLINE EDITING[0m 1296*e4a6e799Ssimonb When entering a command line at the bottom of the screen (for example, 1297*e4a6e799Ssimonb a filename for the :e command, or the pattern for a search command), 1298*e4a6e799Ssimonb certain keys can be used to manipulate the command line. Most commands 1299*e4a6e799Ssimonb have an alternate form in [ brackets ] which can be used if a key does 1300*e4a6e799Ssimonb not exist on a particular keyboard. (Note that the forms beginning 1301*e4a6e799Ssimonb with ESC do not work in some MS-DOS and Windows systems because ESC is 1302*e4a6e799Ssimonb the line erase character.) Any of these special keys may be entered 1303*e4a6e799Ssimonb literally by preceding it with the "literal" character, either ^V or 1304*e4a6e799Ssimonb ^A. A backslash itself may also be entered literally by entering two 1305*e4a6e799Ssimonb backslashes. 1306*e4a6e799Ssimonb 1307*e4a6e799Ssimonb LEFTARROW [ ESC-h ] 1308*e4a6e799Ssimonb Move the cursor one space to the left. 1309*e4a6e799Ssimonb 1310*e4a6e799Ssimonb RIGHTARROW [ ESC-l ] 1311*e4a6e799Ssimonb Move the cursor one space to the right. 1312*e4a6e799Ssimonb 1313*e4a6e799Ssimonb ^LEFTARROW [ ESC-b or ESC-LEFTARROW ] 1314*e4a6e799Ssimonb (That is, CONTROL and LEFTARROW simultaneously.) Move the cur‐ 1315*e4a6e799Ssimonb sor one word to the left. 1316*e4a6e799Ssimonb 1317*e4a6e799Ssimonb ^RIGHTARROW [ ESC-w or ESC-RIGHTARROW ] 1318*e4a6e799Ssimonb (That is, CONTROL and RIGHTARROW simultaneously.) Move the cur‐ 1319*e4a6e799Ssimonb sor one word to the right. 1320*e4a6e799Ssimonb 1321*e4a6e799Ssimonb HOME [ ESC-0 ] 1322*e4a6e799Ssimonb Move the cursor to the beginning of the line. 1323*e4a6e799Ssimonb 1324*e4a6e799Ssimonb END [ ESC-$ ] 1325*e4a6e799Ssimonb Move the cursor to the end of the line. 1326*e4a6e799Ssimonb 1327*e4a6e799Ssimonb BACKSPACE 1328*e4a6e799Ssimonb Delete the character to the left of the cursor, or cancel the 1329*e4a6e799Ssimonb command if the command line is empty. 1330*e4a6e799Ssimonb 1331*e4a6e799Ssimonb DELETE or [ ESC-x ] 1332*e4a6e799Ssimonb Delete the character under the cursor. 1333*e4a6e799Ssimonb 1334*e4a6e799Ssimonb ^BACKSPACE [ ESC-BACKSPACE ] 1335*e4a6e799Ssimonb (That is, CONTROL and BACKSPACE simultaneously.) Delete the 1336*e4a6e799Ssimonb word to the left of the cursor. 1337*e4a6e799Ssimonb 1338*e4a6e799Ssimonb ^DELETE [ ESC-X or ESC-DELETE ] 1339*e4a6e799Ssimonb (That is, CONTROL and DELETE simultaneously.) Delete the word 1340*e4a6e799Ssimonb under the cursor. 1341*e4a6e799Ssimonb 1342*e4a6e799Ssimonb UPARROW [ ESC-k ] 1343*e4a6e799Ssimonb Retrieve the previous command line. If you first enter some 1344*e4a6e799Ssimonb text and then press UPARROW, it will retrieve the previous com‐ 1345*e4a6e799Ssimonb mand which begins with that text. 1346*e4a6e799Ssimonb 1347*e4a6e799Ssimonb DOWNARROW [ ESC-j ] 1348*e4a6e799Ssimonb Retrieve the next command line. If you first enter some text 1349*e4a6e799Ssimonb and then press DOWNARROW, it will retrieve the next command 1350*e4a6e799Ssimonb which begins with that text. 1351*e4a6e799Ssimonb 1352*e4a6e799Ssimonb TAB Complete the partial filename to the left of the cursor. If it 1353*e4a6e799Ssimonb matches more than one filename, the first match is entered into 1354*e4a6e799Ssimonb the command line. Repeated TABs will cycle thru the other 1355*e4a6e799Ssimonb matching filenames. If the completed filename is a directory, a 1356*e4a6e799Ssimonb "/" is appended to the filename. (On MS-DOS systems, a "\" is 1357*e4a6e799Ssimonb appended.) The environment variable LESSSEPARATOR can be used 1358*e4a6e799Ssimonb to specify a different character to append to a directory name. 1359*e4a6e799Ssimonb 1360*e4a6e799Ssimonb BACKTAB [ ESC-TAB ] 1361*e4a6e799Ssimonb Like, TAB, but cycles in the reverse direction thru the matching 1362*e4a6e799Ssimonb filenames. 1363*e4a6e799Ssimonb 1364*e4a6e799Ssimonb ^L Complete the partial filename to the left of the cursor. If it 1365*e4a6e799Ssimonb matches more than one filename, all matches are entered into the 1366*e4a6e799Ssimonb command line (if they fit). 1367*e4a6e799Ssimonb 1368*e4a6e799Ssimonb ^U (Unix and OS/2) or ESC (MS-DOS) 1369*e4a6e799Ssimonb Delete the entire command line, or cancel the command if the 1370*e4a6e799Ssimonb command line is empty. If you have changed your line-kill char‐ 1371*e4a6e799Ssimonb acter in Unix to something other than ^U, that character is used 1372*e4a6e799Ssimonb instead of ^U. 1373*e4a6e799Ssimonb 1374*e4a6e799Ssimonb ^G Delete the entire command line and return to the main prompt. 1375*e4a6e799Ssimonb 1376*e4a6e799Ssimonb[1mKEY BINDINGS[0m 1377*e4a6e799Ssimonb You may define your own [1mless [22mcommands by creating a lesskey source 1378*e4a6e799Ssimonb file. This file specifies a set of command keys and an action associ‐ 1379*e4a6e799Ssimonb ated with each key. You may also change the line-editing keys (see 1380*e4a6e799Ssimonb LINE EDITING), and set environment variables used by [1mless[22m. See the 1381*e4a6e799Ssimonb [1mlesskey[22m(1) manual page for details about the file format. 1382*e4a6e799Ssimonb 1383*e4a6e799Ssimonb If the environment variable LESSKEYIN is set, [1mless [22muses that as the 1384*e4a6e799Ssimonb name of the lesskey source file. Otherwise, [1mless [22mlooks in a standard 1385*e4a6e799Ssimonb place for the lesskey source file: On Unix systems, [1mless [22mlooks for a 1386*e4a6e799Ssimonb lesskey file called "$XDG_CONFIG_HOME/lesskey" or "$HOME/.con‐ 1387*e4a6e799Ssimonb fig/lesskey" or "$HOME/.lesskey". On MS-DOS and Windows systems, [1mless[0m 1388*e4a6e799Ssimonb looks for a lesskey file called "$HOME/_lesskey", and if it is not 1389*e4a6e799Ssimonb found there, then looks for a lesskey file called "_lesskey" in any di‐ 1390*e4a6e799Ssimonb rectory specified in the PATH environment variable. On OS/2 systems, 1391*e4a6e799Ssimonb [1mless [22mlooks for a lesskey file called "$HOME/lesskey.ini", and if it is 1392*e4a6e799Ssimonb not found, then looks for a lesskey file called "lesskey.ini" in any 1393*e4a6e799Ssimonb directory specified in the INIT environment variable, and if it not 1394*e4a6e799Ssimonb found there, then looks for a lesskey file called "lesskey.ini" in any 1395*e4a6e799Ssimonb directory specified in the PATH environment variable. 1396*e4a6e799Ssimonb 1397*e4a6e799Ssimonb A system-wide lesskey source file may also be set up to provide key 1398*e4a6e799Ssimonb bindings. If a key is defined in both a local lesskey file and in the 1399*e4a6e799Ssimonb system-wide file, key bindings in the local file take precedence over 1400*e4a6e799Ssimonb those in the system-wide file. If the environment variable 1401*e4a6e799Ssimonb LESSKEYIN_SYSTEM is set, [1mless [22muses that as the name of the system-wide 1402*e4a6e799Ssimonb lesskey file. Otherwise, [1mless [22mlooks in a standard place for the sys‐ 1403*e4a6e799Ssimonb tem-wide lesskey file: On Unix systems, the system-wide lesskey file is 1404*e4a6e799Ssimonb /usr/local/etc/syslesskey. (However, if [1mless [22mwas built with a differ‐ 1405*e4a6e799Ssimonb ent sysconf directory than /usr/local/etc, that directory is where the 1406*e4a6e799Ssimonb sysless file is found.) On MS-DOS and Windows systems, the system-wide 1407*e4a6e799Ssimonb lesskey file is c:\_syslesskey. On OS/2 systems, the system-wide 1408*e4a6e799Ssimonb lesskey file is c:\syslesskey.ini. 1409*e4a6e799Ssimonb 1410*e4a6e799Ssimonb Previous versions of [1mless [22m(before v582) used lesskey files with a bina‐ 1411*e4a6e799Ssimonb ry format, produced by the [1mlesskey [22mprogram. It is no longer necessary 1412*e4a6e799Ssimonb to use the [1mlesskey [22mprogram. 1413*e4a6e799Ssimonb 1414*e4a6e799Ssimonb[1mINPUT PREPROCESSOR[0m 1415*e4a6e799Ssimonb You may define an "input preprocessor" for [1mless[22m. Before [1mless [22mopens a 1416*e4a6e799Ssimonb file, it first gives your input preprocessor a chance to modify the way 1417*e4a6e799Ssimonb the contents of the file are displayed. An input preprocessor is sim‐ 1418*e4a6e799Ssimonb ply an executable program (or shell script), which writes the contents 1419*e4a6e799Ssimonb of the file to a different file, called the replacement file. The con‐ 1420*e4a6e799Ssimonb tents of the replacement file are then displayed in place of the con‐ 1421*e4a6e799Ssimonb tents of the original file. However, it will appear to the user as if 1422*e4a6e799Ssimonb the original file is opened; that is, [1mless [22mwill display the original 1423*e4a6e799Ssimonb filename as the name of the current file. 1424*e4a6e799Ssimonb 1425*e4a6e799Ssimonb An input preprocessor receives one command line argument, the original 1426*e4a6e799Ssimonb filename, as entered by the user. It should create the replacement 1427*e4a6e799Ssimonb file, and when finished, print the name of the replacement file to its 1428*e4a6e799Ssimonb standard output. If the input preprocessor does not output a replace‐ 1429*e4a6e799Ssimonb ment filename, [1mless [22muses the original file, as normal. The input pre‐ 1430*e4a6e799Ssimonb processor is not called when viewing standard input. To set up an in‐ 1431*e4a6e799Ssimonb put preprocessor, set the LESSOPEN environment variable to a command 1432*e4a6e799Ssimonb line which will invoke your input preprocessor. This command line 1433*e4a6e799Ssimonb should include one occurrence of the string "%s", which will be re‐ 1434*e4a6e799Ssimonb placed by the filename when the input preprocessor command is invoked. 1435*e4a6e799Ssimonb 1436*e4a6e799Ssimonb When [1mless [22mcloses a file opened in such a way, it will call another pro‐ 1437*e4a6e799Ssimonb gram, called the input postprocessor, which may perform any desired 1438*e4a6e799Ssimonb clean-up action (such as deleting the replacement file created by 1439*e4a6e799Ssimonb LESSOPEN). This program receives two command line arguments, the orig‐ 1440*e4a6e799Ssimonb inal filename as entered by the user, and the name of the replacement 1441*e4a6e799Ssimonb file. To set up an input postprocessor, set the LESSCLOSE environment 1442*e4a6e799Ssimonb variable to a command line which will invoke your input postprocessor. 1443*e4a6e799Ssimonb It may include two occurrences of the string "%s"; the first is re‐ 1444*e4a6e799Ssimonb placed with the original name of the file and the second with the name 1445*e4a6e799Ssimonb of the replacement file, which was output by LESSOPEN. 1446*e4a6e799Ssimonb 1447*e4a6e799Ssimonb For example, on many Unix systems, these two scripts will allow you to 1448*e4a6e799Ssimonb keep files in compressed format, but still let [1mless [22mview them directly: 1449*e4a6e799Ssimonb 1450*e4a6e799Ssimonb lessopen.sh: 1451*e4a6e799Ssimonb #! /bin/sh 1452*e4a6e799Ssimonb case "$1" in 1453*e4a6e799Ssimonb *.Z) TEMPFILE=$(mktemp) 1454*e4a6e799Ssimonb uncompress -c $1 >$TEMPFILE 2>/dev/null 1455*e4a6e799Ssimonb if [ -s $TEMPFILE ]; then 1456*e4a6e799Ssimonb echo $TEMPFILE 1457*e4a6e799Ssimonb else 1458*e4a6e799Ssimonb rm -f $TEMPFILE 1459*e4a6e799Ssimonb fi 1460*e4a6e799Ssimonb ;; 1461*e4a6e799Ssimonb esac 1462*e4a6e799Ssimonb 1463*e4a6e799Ssimonb lessclose.sh: 1464*e4a6e799Ssimonb #! /bin/sh 1465*e4a6e799Ssimonb rm $2 1466*e4a6e799Ssimonb 1467*e4a6e799Ssimonb To use these scripts, put them both where they can be executed and set 1468*e4a6e799Ssimonb LESSOPEN="lessopen.sh %s", and LESSCLOSE="lessclose.sh %s %s". More 1469*e4a6e799Ssimonb complex LESSOPEN and LESSCLOSE scripts may be written to accept other 1470*e4a6e799Ssimonb types of compressed files, and so on. 1471*e4a6e799Ssimonb 1472*e4a6e799Ssimonb It is also possible to set up an input preprocessor to pipe the file 1473*e4a6e799Ssimonb data directly to [1mless[22m, rather than putting the data into a replacement 1474*e4a6e799Ssimonb file. This avoids the need to decompress the entire file before start‐ 1475*e4a6e799Ssimonb ing to view it. An input preprocessor that works this way is called an 1476*e4a6e799Ssimonb input pipe. An input pipe, instead of writing the name of a replace‐ 1477*e4a6e799Ssimonb ment file on its standard output, writes the entire contents of the re‐ 1478*e4a6e799Ssimonb placement file on its standard output. If the input pipe does not 1479*e4a6e799Ssimonb write any characters on its standard output, then there is no replace‐ 1480*e4a6e799Ssimonb ment file and [1mless [22muses the original file, as normal. To use an input 1481*e4a6e799Ssimonb pipe, make the first character in the LESSOPEN environment variable a 1482*e4a6e799Ssimonb vertical bar (|) to signify that the input preprocessor is an input 1483*e4a6e799Ssimonb pipe. As with non-pipe input preprocessors, the command string must 1484*e4a6e799Ssimonb contain one occurrence of %s, which is replaced with the filename of 1485*e4a6e799Ssimonb the input file. 1486*e4a6e799Ssimonb 1487*e4a6e799Ssimonb For example, on many Unix systems, this script will work like the pre‐ 1488*e4a6e799Ssimonb vious example scripts: 1489*e4a6e799Ssimonb 1490*e4a6e799Ssimonb lesspipe.sh: 1491*e4a6e799Ssimonb #! /bin/sh 1492*e4a6e799Ssimonb case "$1" in 1493*e4a6e799Ssimonb *.Z) uncompress -c $1 2>/dev/null 1494*e4a6e799Ssimonb ;; 1495*e4a6e799Ssimonb *) exit 1 1496*e4a6e799Ssimonb ;; 1497*e4a6e799Ssimonb esac 1498*e4a6e799Ssimonb exit $? 1499*e4a6e799Ssimonb 1500*e4a6e799Ssimonb To use this script, put it where it can be executed and set 1501*e4a6e799Ssimonb LESSOPEN="|lesspipe.sh %s". 1502*e4a6e799Ssimonb 1503*e4a6e799Ssimonb Note that a preprocessor cannot output an empty file, since that is in‐ 1504*e4a6e799Ssimonb terpreted as meaning there is no replacement, and the original file is 1505*e4a6e799Ssimonb used. To avoid this, if LESSOPEN starts with two vertical bars, the 1506*e4a6e799Ssimonb exit status of the script determines the behavior when the output is 1507*e4a6e799Ssimonb empty. If the output is empty and the exit status is zero, the empty 1508*e4a6e799Ssimonb output is considered to be replacement text. If the output is empty 1509*e4a6e799Ssimonb and the exit status is nonzero, the original file is used. For compat‐ 1510*e4a6e799Ssimonb ibility with previous versions of [1mless[22m, if LESSOPEN starts with only 1511*e4a6e799Ssimonb one vertical bar, the exit status of the preprocessor is ignored. 1512*e4a6e799Ssimonb 1513*e4a6e799Ssimonb When an input pipe is used, a LESSCLOSE postprocessor can be used, but 1514*e4a6e799Ssimonb it is usually not necessary since there is no replacement file to clean 1515*e4a6e799Ssimonb up. In this case, the replacement file name passed to the LESSCLOSE 1516*e4a6e799Ssimonb postprocessor is "-". 1517*e4a6e799Ssimonb 1518*e4a6e799Ssimonb For compatibility with previous versions of [1mless[22m, the input preproces‐ 1519*e4a6e799Ssimonb sor or pipe is not used if [1mless [22mis viewing standard input. However, if 1520*e4a6e799Ssimonb the first character of LESSOPEN is a dash (-), the input preprocessor 1521*e4a6e799Ssimonb is used on standard input as well as other files. In this case, the 1522*e4a6e799Ssimonb dash is not considered to be part of the preprocessor command. If 1523*e4a6e799Ssimonb standard input is being viewed, the input preprocessor is passed a file 1524*e4a6e799Ssimonb name consisting of a single dash. Similarly, if the first two charac‐ 1525*e4a6e799Ssimonb ters of LESSOPEN are vertical bar and dash (|-) or two vertical bars 1526*e4a6e799Ssimonb and a dash (||-), the input pipe is used on standard input as well as 1527*e4a6e799Ssimonb other files. Again, in this case the dash is not considered to be part 1528*e4a6e799Ssimonb of the input pipe command. 1529*e4a6e799Ssimonb 1530*e4a6e799Ssimonb[1mNATIONAL CHARACTER SETS[0m 1531*e4a6e799Ssimonb There are three types of characters in the input file: 1532*e4a6e799Ssimonb 1533*e4a6e799Ssimonb normal characters 1534*e4a6e799Ssimonb can be displayed directly to the screen. 1535*e4a6e799Ssimonb 1536*e4a6e799Ssimonb control characters 1537*e4a6e799Ssimonb should not be displayed directly, but are expected to be found 1538*e4a6e799Ssimonb in ordinary text files (such as backspace and tab). 1539*e4a6e799Ssimonb 1540*e4a6e799Ssimonb binary characters 1541*e4a6e799Ssimonb should not be displayed directly and are not expected to be 1542*e4a6e799Ssimonb found in text files. 1543*e4a6e799Ssimonb 1544*e4a6e799Ssimonb A "character set" is simply a description of which characters are to be 1545*e4a6e799Ssimonb considered normal, control, and binary. The LESSCHARSET environment 1546*e4a6e799Ssimonb variable may be used to select a character set. Possible values for 1547*e4a6e799Ssimonb LESSCHARSET are: 1548*e4a6e799Ssimonb 1549*e4a6e799Ssimonb ascii BS, TAB, NL, CR, and formfeed are control characters, all chars 1550*e4a6e799Ssimonb with values between 32 and 126 are normal, and all others are 1551*e4a6e799Ssimonb binary. 1552*e4a6e799Ssimonb 1553*e4a6e799Ssimonb iso8859 1554*e4a6e799Ssimonb Selects an ISO 8859 character set. This is the same as ASCII, 1555*e4a6e799Ssimonb except characters between 160 and 255 are treated as normal 1556*e4a6e799Ssimonb characters. 1557*e4a6e799Ssimonb 1558*e4a6e799Ssimonb latin1 Same as iso8859. 1559*e4a6e799Ssimonb 1560*e4a6e799Ssimonb latin9 Same as iso8859. 1561*e4a6e799Ssimonb 1562*e4a6e799Ssimonb dos Selects a character set appropriate for MS-DOS. 1563*e4a6e799Ssimonb 1564*e4a6e799Ssimonb ebcdic Selects an EBCDIC character set. 1565*e4a6e799Ssimonb 1566*e4a6e799Ssimonb IBM-1047 1567*e4a6e799Ssimonb Selects an EBCDIC character set used by OS/390 Unix Services. 1568*e4a6e799Ssimonb This is the EBCDIC analogue of latin1. You get similar results 1569*e4a6e799Ssimonb by setting either LESSCHARSET=IBM-1047 or LC_CTYPE=en_US in your 1570*e4a6e799Ssimonb environment. 1571*e4a6e799Ssimonb 1572*e4a6e799Ssimonb koi8-r Selects a Russian character set. 1573*e4a6e799Ssimonb 1574*e4a6e799Ssimonb next Selects a character set appropriate for NeXT computers. 1575*e4a6e799Ssimonb 1576*e4a6e799Ssimonb utf-8 Selects the UTF-8 encoding of the ISO 10646 character set. 1577*e4a6e799Ssimonb UTF-8 is special in that it supports multi-byte characters in 1578*e4a6e799Ssimonb the input file. It is the only character set that supports mul‐ 1579*e4a6e799Ssimonb ti-byte characters. 1580*e4a6e799Ssimonb 1581*e4a6e799Ssimonb windows 1582*e4a6e799Ssimonb Selects a character set appropriate for Microsoft Windows (cp 1583*e4a6e799Ssimonb 1251). 1584*e4a6e799Ssimonb 1585*e4a6e799Ssimonb In rare cases, it may be desired to tailor [1mless [22mto use a character set 1586*e4a6e799Ssimonb other than the ones definable by LESSCHARSET. In this case, the envi‐ 1587*e4a6e799Ssimonb ronment variable LESSCHARDEF can be used to define a character set. It 1588*e4a6e799Ssimonb should be set to a string where each character in the string represents 1589*e4a6e799Ssimonb one character in the character set. The character "." is used for a 1590*e4a6e799Ssimonb normal character, "c" for control, and "b" for binary. A decimal num‐ 1591*e4a6e799Ssimonb ber may be used for repetition. For example, "bccc4b." would mean 1592*e4a6e799Ssimonb character 0 is binary, 1, 2 and 3 are control, 4, 5, 6 and 7 are bina‐ 1593*e4a6e799Ssimonb ry, and 8 is normal. All characters after the last are taken to be the 1594*e4a6e799Ssimonb same as the last, so characters 9 through 255 would be normal. (This 1595*e4a6e799Ssimonb is an example, and does not necessarily represent any real character 1596*e4a6e799Ssimonb set.) 1597*e4a6e799Ssimonb 1598*e4a6e799Ssimonb This table shows the value of LESSCHARDEF which is equivalent to each 1599*e4a6e799Ssimonb of the possible values for LESSCHARSET: 1600*e4a6e799Ssimonb 1601*e4a6e799Ssimonb 1602*e4a6e799Ssimonb ascii 8bcccbcc18b95.b 1603*e4a6e799Ssimonb dos 8bcccbcc12bc5b95.b. 1604*e4a6e799Ssimonb ebcdic 5bc6bcc7bcc41b.9b7.9b5.b..8b6.10b6.b9.7b 1605*e4a6e799Ssimonb 9.8b8.17b3.3b9.7b9.8b8.6b10.b.b.b. 1606*e4a6e799Ssimonb IBM-1047 4cbcbc3b9cbccbccbb4c6bcc5b3cbbc4bc4bccbc 1607*e4a6e799Ssimonb 191.b 1608*e4a6e799Ssimonb iso8859 8bcccbcc18b95.33b. 1609*e4a6e799Ssimonb koi8-r 8bcccbcc18b95.b128. 1610*e4a6e799Ssimonb latin1 8bcccbcc18b95.33b. 1611*e4a6e799Ssimonb next 8bcccbcc18b95.bb125.bb 1612*e4a6e799Ssimonb 1613*e4a6e799Ssimonb If neither LESSCHARSET nor LESSCHARDEF is set, but any of the strings 1614*e4a6e799Ssimonb "UTF-8", "UTF8", "utf-8" or "utf8" is found in the LC_ALL, LC_CTYPE or 1615*e4a6e799Ssimonb LANG environment variables, then the default character set is utf-8. 1616*e4a6e799Ssimonb 1617*e4a6e799Ssimonb If that string is not found, but your system supports the [1msetlocale [22min‐ 1618*e4a6e799Ssimonb terface, [1mless [22mwill use setlocale to determine the character set. set‐ 1619*e4a6e799Ssimonb locale is controlled by setting the LANG or LC_CTYPE environment vari‐ 1620*e4a6e799Ssimonb ables. 1621*e4a6e799Ssimonb 1622*e4a6e799Ssimonb Finally, if the [4msetlocale[24m interface is also not available, the default 1623*e4a6e799Ssimonb character set is latin1. 1624*e4a6e799Ssimonb 1625*e4a6e799Ssimonb Control and binary characters are displayed in standout (reverse 1626*e4a6e799Ssimonb video). Each such character is displayed in caret notation if possible 1627*e4a6e799Ssimonb (e.g. ^A for control-A). Caret notation is used only if inverting the 1628*e4a6e799Ssimonb 0100 bit results in a normal printable character. Otherwise, the char‐ 1629*e4a6e799Ssimonb acter is displayed as a hex number in angle brackets. This format can 1630*e4a6e799Ssimonb be changed by setting the LESSBINFMT environment variable. LESSBINFMT 1631*e4a6e799Ssimonb may begin with a "*" and one character to select the display attribute: 1632*e4a6e799Ssimonb "*k" is blinking, "*d" is bold, "*u" is underlined, "*s" is standout, 1633*e4a6e799Ssimonb and "*n" is normal. If LESSBINFMT does not begin with a "*", normal 1634*e4a6e799Ssimonb attribute is assumed. The remainder of LESSBINFMT is a string which 1635*e4a6e799Ssimonb may include one printf-style escape sequence (a % followed by x, X, o, 1636*e4a6e799Ssimonb d, etc.). For example, if LESSBINFMT is "*u[%x]", binary characters 1637*e4a6e799Ssimonb are displayed in underlined hexadecimal surrounded by brackets. The 1638*e4a6e799Ssimonb default if no LESSBINFMT is specified is "*s<%02X>". Warning: the re‐ 1639*e4a6e799Ssimonb sult of expanding the character via LESSBINFMT must be less than 31 1640*e4a6e799Ssimonb characters. 1641*e4a6e799Ssimonb 1642*e4a6e799Ssimonb When the character set is utf-8, the LESSUTFBINFMT environment variable 1643*e4a6e799Ssimonb acts similarly to LESSBINFMT but it applies to Unicode code points that 1644*e4a6e799Ssimonb were successfully decoded but are unsuitable for display (e.g., unas‐ 1645*e4a6e799Ssimonb signed code points). Its default value is "<U+%04lX>". Note that 1646*e4a6e799Ssimonb LESSUTFBINFMT and LESSBINFMT share their display attribute setting 1647*e4a6e799Ssimonb ("*x") so specifying one will affect both; LESSUTFBINFMT is read after 1648*e4a6e799Ssimonb LESSBINFMT so its setting, if any, will have priority. Problematic 1649*e4a6e799Ssimonb octets in a UTF-8 file (octets of a truncated sequence, octets of a 1650*e4a6e799Ssimonb complete but non-shortest form sequence, invalid octets, and stray 1651*e4a6e799Ssimonb trailing octets) are displayed individually using LESSBINFMT so as to 1652*e4a6e799Ssimonb facilitate diagnostic of how the UTF-8 file is ill-formed. 1653*e4a6e799Ssimonb 1654*e4a6e799Ssimonb When the character set is utf-8, in rare cases it may be desirable to 1655*e4a6e799Ssimonb override the Unicode definition of the type of certain characters. For 1656*e4a6e799Ssimonb example, characters in a Private Use Area are normally treated as con‐ 1657*e4a6e799Ssimonb trol characters, but if you are using a custom font with printable 1658*e4a6e799Ssimonb characters in that range, it may be desirable to tell [1mless [22mto treat 1659*e4a6e799Ssimonb such characters as printable. This can be done by setting the LESSUT‐ 1660*e4a6e799Ssimonb FCHARDEF environment variable to a comma-separated list of [4mcharacter[0m 1661*e4a6e799Ssimonb [4mtype[24m definitions. Each character type definition consists of either 1662*e4a6e799Ssimonb one hexadecimal codepoint or a pair of codepoints separated by a dash, 1663*e4a6e799Ssimonb followed by a colon and a type character. Each hexadecimal codepoint 1664*e4a6e799Ssimonb may optionally be preceded by a "U" or "U+". If a pair of codepoints 1665*e4a6e799Ssimonb is given, the type is set for all characters inclusively between the 1666*e4a6e799Ssimonb two values. If there are multiple comma-separated codepoint values, 1667*e4a6e799Ssimonb they must be in ascending numerical order. The type character may be 1668*e4a6e799Ssimonb one of: 1669*e4a6e799Ssimonb 1670*e4a6e799Ssimonb p A normal printable character. 1671*e4a6e799Ssimonb 1672*e4a6e799Ssimonb w A wide (2-space) printable character. 1673*e4a6e799Ssimonb 1674*e4a6e799Ssimonb b A binary (non-printable) character. 1675*e4a6e799Ssimonb 1676*e4a6e799Ssimonb c A composing (zero width) character. 1677*e4a6e799Ssimonb 1678*e4a6e799Ssimonb For example, setting LESSUTFCHARDEF to 1679*e4a6e799Ssimonb 1680*e4a6e799Ssimonb E000-F8FF:p,F0000-FFFFD:p,100000-10FFFD:p 1681*e4a6e799Ssimonb 1682*e4a6e799Ssimonb would make all Private Use Area characters be treated as printable. 1683*e4a6e799Ssimonb 1684*e4a6e799Ssimonb[1mPROMPTS[0m 1685*e4a6e799Ssimonb The -P option allows you to tailor the prompt to your preference. The 1686*e4a6e799Ssimonb string given to the -P option replaces the specified prompt string. 1687*e4a6e799Ssimonb Certain characters in the string are interpreted specially. The prompt 1688*e4a6e799Ssimonb mechanism is rather complicated to provide flexibility, but the ordi‐ 1689*e4a6e799Ssimonb nary user need not understand the details of constructing personalized 1690*e4a6e799Ssimonb prompt strings. 1691*e4a6e799Ssimonb 1692*e4a6e799Ssimonb A percent sign followed by a single character is expanded according to 1693*e4a6e799Ssimonb what the following character is. (References to the input file size 1694*e4a6e799Ssimonb below refer to the preprocessed size, if an input preprocessor is being 1695*e4a6e799Ssimonb used.) 1696*e4a6e799Ssimonb 1697*e4a6e799Ssimonb %b[4mX[24m Replaced by the byte offset into the current input file. The b 1698*e4a6e799Ssimonb is followed by a single character (shown as [4mX[24m above) which spec‐ 1699*e4a6e799Ssimonb ifies the line whose byte offset is to be used. If the charac‐ 1700*e4a6e799Ssimonb ter is a "t", the byte offset of the top line in the display is 1701*e4a6e799Ssimonb used, an "m" means use the middle line, a "b" means use the bot‐ 1702*e4a6e799Ssimonb tom line, a "B" means use the line just after the bottom line, 1703*e4a6e799Ssimonb and a "j" means use the "target" line, as specified by the -j 1704*e4a6e799Ssimonb option. 1705*e4a6e799Ssimonb 1706*e4a6e799Ssimonb %B Replaced by the size of the current input file. 1707*e4a6e799Ssimonb 1708*e4a6e799Ssimonb %c Replaced by the column number of the text appearing in the first 1709*e4a6e799Ssimonb column of the screen. 1710*e4a6e799Ssimonb 1711*e4a6e799Ssimonb %d[4mX[24m Replaced by the page number of a line in the input file. The 1712*e4a6e799Ssimonb line to be used is determined by the [4mX[24m, as with the %b option. 1713*e4a6e799Ssimonb 1714*e4a6e799Ssimonb %D Replaced by the number of pages in the input file, or equiva‐ 1715*e4a6e799Ssimonb lently, the page number of the last line in the input file. 1716*e4a6e799Ssimonb 1717*e4a6e799Ssimonb %E Replaced by the name of the editor (from the VISUAL environment 1718*e4a6e799Ssimonb variable, or the EDITOR environment variable if VISUAL is not 1719*e4a6e799Ssimonb defined). See the discussion of the LESSEDIT feature below. 1720*e4a6e799Ssimonb 1721*e4a6e799Ssimonb %f Replaced by the name of the current input file. 1722*e4a6e799Ssimonb 1723*e4a6e799Ssimonb %F Replaced by the last component of the name of the current input 1724*e4a6e799Ssimonb file. 1725*e4a6e799Ssimonb 1726*e4a6e799Ssimonb %g Replaced by the shell-escaped name of the current input file. 1727*e4a6e799Ssimonb This is useful when the expanded string will be used in a shell 1728*e4a6e799Ssimonb command, such as in LESSEDIT. 1729*e4a6e799Ssimonb 1730*e4a6e799Ssimonb %i Replaced by the index of the current file in the list of input 1731*e4a6e799Ssimonb files. 1732*e4a6e799Ssimonb 1733*e4a6e799Ssimonb %l[4mX[24m Replaced by the line number of a line in the input file. The 1734*e4a6e799Ssimonb line to be used is determined by the [4mX[24m, as with the %b option. 1735*e4a6e799Ssimonb 1736*e4a6e799Ssimonb %L Replaced by the line number of the last line in the input file. 1737*e4a6e799Ssimonb 1738*e4a6e799Ssimonb %m Replaced by the total number of input files. 1739*e4a6e799Ssimonb 1740*e4a6e799Ssimonb %p[4mX[24m Replaced by the percent into the current input file, based on 1741*e4a6e799Ssimonb byte offsets. The line used is determined by the [4mX[24m as with the 1742*e4a6e799Ssimonb %b option. 1743*e4a6e799Ssimonb 1744*e4a6e799Ssimonb %P[4mX[24m Replaced by the percent into the current input file, based on 1745*e4a6e799Ssimonb line numbers. The line used is determined by the [4mX[24m as with the 1746*e4a6e799Ssimonb %b option. 1747*e4a6e799Ssimonb 1748*e4a6e799Ssimonb %s Same as %B. 1749*e4a6e799Ssimonb 1750*e4a6e799Ssimonb %t Causes any trailing spaces to be removed. Usually used at the 1751*e4a6e799Ssimonb end of the string, but may appear anywhere. 1752*e4a6e799Ssimonb 1753*e4a6e799Ssimonb %T Normally expands to the word "file". However if viewing files 1754*e4a6e799Ssimonb via a tags list using the -t option, it expands to the word 1755*e4a6e799Ssimonb "tag". 1756*e4a6e799Ssimonb 1757*e4a6e799Ssimonb %x Replaced by the name of the next input file in the list. 1758*e4a6e799Ssimonb 1759*e4a6e799Ssimonb If any item is unknown (for example, the file size if input is a pipe), 1760*e4a6e799Ssimonb a question mark is printed instead. 1761*e4a6e799Ssimonb 1762*e4a6e799Ssimonb The format of the prompt string can be changed depending on certain 1763*e4a6e799Ssimonb conditions. A question mark followed by a single character acts like 1764*e4a6e799Ssimonb an "IF": depending on the following character, a condition is evaluat‐ 1765*e4a6e799Ssimonb ed. If the condition is true, any characters following the question 1766*e4a6e799Ssimonb mark and condition character, up to a period, are included in the 1767*e4a6e799Ssimonb prompt. If the condition is false, such characters are not included. 1768*e4a6e799Ssimonb A colon appearing between the question mark and the period can be used 1769*e4a6e799Ssimonb to establish an "ELSE": any characters between the colon and the period 1770*e4a6e799Ssimonb are included in the string if and only if the IF condition is false. 1771*e4a6e799Ssimonb Condition characters (which follow a question mark) may be: 1772*e4a6e799Ssimonb 1773*e4a6e799Ssimonb ?a True if any characters have been included in the prompt so far. 1774*e4a6e799Ssimonb 1775*e4a6e799Ssimonb ?b[4mX[24m True if the byte offset of the specified line is known. 1776*e4a6e799Ssimonb 1777*e4a6e799Ssimonb ?B True if the size of current input file is known. 1778*e4a6e799Ssimonb 1779*e4a6e799Ssimonb ?c True if the text is horizontally shifted (%c is not zero). 1780*e4a6e799Ssimonb 1781*e4a6e799Ssimonb ?d[4mX[24m True if the page number of the specified line is known. 1782*e4a6e799Ssimonb 1783*e4a6e799Ssimonb ?e True if at end-of-file. 1784*e4a6e799Ssimonb 1785*e4a6e799Ssimonb ?f True if there is an input filename (that is, if input is not a 1786*e4a6e799Ssimonb pipe). 1787*e4a6e799Ssimonb 1788*e4a6e799Ssimonb ?l[4mX[24m True if the line number of the specified line is known. 1789*e4a6e799Ssimonb 1790*e4a6e799Ssimonb ?L True if the line number of the last line in the file is known. 1791*e4a6e799Ssimonb 1792*e4a6e799Ssimonb ?m True if there is more than one input file. 1793*e4a6e799Ssimonb 1794*e4a6e799Ssimonb ?n True if this is the first prompt in a new input file. 1795*e4a6e799Ssimonb 1796*e4a6e799Ssimonb ?p[4mX[24m True if the percent into the current input file, based on byte 1797*e4a6e799Ssimonb offsets, of the specified line is known. 1798*e4a6e799Ssimonb 1799*e4a6e799Ssimonb ?P[4mX[24m True if the percent into the current input file, based on line 1800*e4a6e799Ssimonb numbers, of the specified line is known. 1801*e4a6e799Ssimonb 1802*e4a6e799Ssimonb ?s Same as "?B". 1803*e4a6e799Ssimonb 1804*e4a6e799Ssimonb ?x True if there is a next input file (that is, if the current in‐ 1805*e4a6e799Ssimonb put file is not the last one). 1806*e4a6e799Ssimonb 1807*e4a6e799Ssimonb Any characters other than the special ones (question mark, colon, peri‐ 1808*e4a6e799Ssimonb od, percent, and backslash) become literally part of the prompt. Any 1809*e4a6e799Ssimonb of the special characters may be included in the prompt literally by 1810*e4a6e799Ssimonb preceding it with a backslash. 1811*e4a6e799Ssimonb 1812*e4a6e799Ssimonb Some examples: 1813*e4a6e799Ssimonb 1814*e4a6e799Ssimonb ?f%f:Standard input. 1815*e4a6e799Ssimonb 1816*e4a6e799Ssimonb This prompt prints the filename, if known; otherwise the string "Stan‐ 1817*e4a6e799Ssimonb dard input". 1818*e4a6e799Ssimonb 1819*e4a6e799Ssimonb ?f%f .?ltLine %lt:?pt%pt\%:?btByte %bt:-... 1820*e4a6e799Ssimonb 1821*e4a6e799Ssimonb This prompt would print the filename, if known. The filename is fol‐ 1822*e4a6e799Ssimonb lowed by the line number, if known, otherwise the percent if known, 1823*e4a6e799Ssimonb otherwise the byte offset if known. Otherwise, a dash is printed. No‐ 1824*e4a6e799Ssimonb tice how each question mark has a matching period, and how the % after 1825*e4a6e799Ssimonb the %pt is included literally by escaping it with a backslash. 1826*e4a6e799Ssimonb 1827*e4a6e799Ssimonb ?n?f%f .?m(%T %i of %m) ..?e(END) ?x- Next\: %x..%t"; 1828*e4a6e799Ssimonb 1829*e4a6e799Ssimonb This prints the filename if this is the first prompt in a file, fol‐ 1830*e4a6e799Ssimonb lowed by the "file N of N" message if there is more than one input 1831*e4a6e799Ssimonb file. Then, if we are at end-of-file, the string "(END)" is printed 1832*e4a6e799Ssimonb followed by the name of the next file, if there is one. Finally, any 1833*e4a6e799Ssimonb trailing spaces are truncated. This is the default prompt. For refer‐ 1834*e4a6e799Ssimonb ence, here are the defaults for the other two prompts (-m and -M re‐ 1835*e4a6e799Ssimonb spectively). Each is broken into two lines here for readability only. 1836*e4a6e799Ssimonb 1837*e4a6e799Ssimonb ?n?f%f .?m(%T %i of %m) ..?e(END) ?x- Next\: %x.: 1838*e4a6e799Ssimonb ?pB%pB\%:byte %bB?s/%s...%t 1839*e4a6e799Ssimonb 1840*e4a6e799Ssimonb ?f%f .?n?m(%T %i of %m) ..?ltlines %lt-%lb?L/%L. : 1841*e4a6e799Ssimonb byte %bB?s/%s. .?e(END) ?x- Next\: %x.:?pB%pB\%..%t 1842*e4a6e799Ssimonb 1843*e4a6e799Ssimonb And here is the default message produced by the = command: 1844*e4a6e799Ssimonb 1845*e4a6e799Ssimonb ?f%f .?m(%T %i of %m) .?ltlines %lt-%lb?L/%L. . 1846*e4a6e799Ssimonb byte %bB?s/%s. ?e(END) :?pB%pB\%..%t 1847*e4a6e799Ssimonb 1848*e4a6e799Ssimonb The prompt expansion features are also used for another purpose: if an 1849*e4a6e799Ssimonb environment variable LESSEDIT is defined, it is used as the command to 1850*e4a6e799Ssimonb be executed when the v command is invoked. The LESSEDIT string is ex‐ 1851*e4a6e799Ssimonb panded in the same way as the prompt strings. The default value for 1852*e4a6e799Ssimonb LESSEDIT is: 1853*e4a6e799Ssimonb 1854*e4a6e799Ssimonb %E ?lm+%lm. %g 1855*e4a6e799Ssimonb 1856*e4a6e799Ssimonb Note that this expands to the editor name, followed by a + and the line 1857*e4a6e799Ssimonb number, followed by the shell-escaped file name. If your editor does 1858*e4a6e799Ssimonb not accept the "+linenumber" syntax, or has other differences in invo‐ 1859*e4a6e799Ssimonb cation syntax, the LESSEDIT variable can be changed to modify this de‐ 1860*e4a6e799Ssimonb fault. 1861*e4a6e799Ssimonb 1862*e4a6e799Ssimonb[1mSECURITY[0m 1863*e4a6e799Ssimonb When the environment variable LESSSECURE is set to 1, [1mless [22mruns in a 1864*e4a6e799Ssimonb "secure" mode. This means these features are disabled: 1865*e4a6e799Ssimonb 1866*e4a6e799Ssimonb ! the shell command 1867*e4a6e799Ssimonb 1868*e4a6e799Ssimonb # the pshell command 1869*e4a6e799Ssimonb 1870*e4a6e799Ssimonb | the pipe command 1871*e4a6e799Ssimonb 1872*e4a6e799Ssimonb :e the examine command. 1873*e4a6e799Ssimonb 1874*e4a6e799Ssimonb v the editing command 1875*e4a6e799Ssimonb 1876*e4a6e799Ssimonb s -o log files 1877*e4a6e799Ssimonb 1878*e4a6e799Ssimonb -k use of lesskey files 1879*e4a6e799Ssimonb 1880*e4a6e799Ssimonb -t use of tags files 1881*e4a6e799Ssimonb 1882*e4a6e799Ssimonb metacharacters in filenames, such as * 1883*e4a6e799Ssimonb 1884*e4a6e799Ssimonb filename completion (TAB, ^L) 1885*e4a6e799Ssimonb 1886*e4a6e799Ssimonb history file 1887*e4a6e799Ssimonb 1888*e4a6e799Ssimonb Less can also be compiled to be permanently in "secure" mode. 1889*e4a6e799Ssimonb 1890*e4a6e799Ssimonb[1mCOMPATIBILITY WITH MORE[0m 1891*e4a6e799Ssimonb If the environment variable LESS_IS_MORE is set to 1, or if the program 1892*e4a6e799Ssimonb is invoked via a file link named "more", [1mless [22mbehaves (mostly) in con‐ 1893*e4a6e799Ssimonb formance with the POSIX [1mmore[22m(1) command specification. In this mode, 1894*e4a6e799Ssimonb less behaves differently in these ways: 1895*e4a6e799Ssimonb 1896*e4a6e799Ssimonb The -e option works differently. If the -e option is not set, [1mless [22mbe‐ 1897*e4a6e799Ssimonb haves as if the -e option were set. If the -e option is set, [1mless [22mbe‐ 1898*e4a6e799Ssimonb haves as if the -E option were set. 1899*e4a6e799Ssimonb 1900*e4a6e799Ssimonb The -m option works differently. If the -m option is not set, the 1901*e4a6e799Ssimonb medium prompt is used, and it is prefixed with the string "--More--". 1902*e4a6e799Ssimonb If the -m option is set, the short prompt is used. 1903*e4a6e799Ssimonb 1904*e4a6e799Ssimonb The -n option acts like the -z option. The normal behavior of the -n 1905*e4a6e799Ssimonb option is unavailable in this mode. 1906*e4a6e799Ssimonb 1907*e4a6e799Ssimonb The parameter to the -p option is taken to be a [1mless [22mcommand rather 1908*e4a6e799Ssimonb than a search pattern. 1909*e4a6e799Ssimonb 1910*e4a6e799Ssimonb The LESS environment variable is ignored, and the MORE environment 1911*e4a6e799Ssimonb variable is used in its place. 1912*e4a6e799Ssimonb 1913*e4a6e799Ssimonb[1mENVIRONMENT VARIABLES[0m 1914*e4a6e799Ssimonb Environment variables may be specified either in the system environment 1915*e4a6e799Ssimonb as usual, or in a [1mlesskey[22m(1) file. If environment variables are de‐ 1916*e4a6e799Ssimonb fined in more than one place, variables defined in a local lesskey file 1917*e4a6e799Ssimonb take precedence over variables defined in the system environment, which 1918*e4a6e799Ssimonb take precedence over variables defined in the system-wide lesskey file. 1919*e4a6e799Ssimonb 1920*e4a6e799Ssimonb COLUMNS 1921*e4a6e799Ssimonb Sets the number of columns on the screen. Takes precedence over 1922*e4a6e799Ssimonb the number of columns specified by the TERM variable. (But if 1923*e4a6e799Ssimonb you have a windowing system which supports TIOCGWINSZ or 1924*e4a6e799Ssimonb WIOCGETD, the window system's idea of the screen size takes 1925*e4a6e799Ssimonb precedence over the LINES and COLUMNS environment variables.) 1926*e4a6e799Ssimonb 1927*e4a6e799Ssimonb EDITOR The name of the editor (used for the v command). 1928*e4a6e799Ssimonb 1929*e4a6e799Ssimonb HOME Name of the user's home directory (used to find a lesskey file 1930*e4a6e799Ssimonb on Unix and OS/2 systems). 1931*e4a6e799Ssimonb 1932*e4a6e799Ssimonb HOMEDRIVE, HOMEPATH 1933*e4a6e799Ssimonb Concatenation of the HOMEDRIVE and HOMEPATH environment vari‐ 1934*e4a6e799Ssimonb ables is the name of the user's home directory if the HOME vari‐ 1935*e4a6e799Ssimonb able is not set (only in the Windows version). 1936*e4a6e799Ssimonb 1937*e4a6e799Ssimonb INIT Name of the user's init directory (used to find a lesskey file 1938*e4a6e799Ssimonb on OS/2 systems). 1939*e4a6e799Ssimonb 1940*e4a6e799Ssimonb LANG Language for determining the character set. 1941*e4a6e799Ssimonb 1942*e4a6e799Ssimonb LC_CTYPE 1943*e4a6e799Ssimonb Language for determining the character set. 1944*e4a6e799Ssimonb 1945*e4a6e799Ssimonb LESS Options which are passed to [1mless [22mautomatically. 1946*e4a6e799Ssimonb 1947*e4a6e799Ssimonb LESSANSIENDCHARS 1948*e4a6e799Ssimonb Characters which may end an ANSI color escape sequence (default 1949*e4a6e799Ssimonb "m"). 1950*e4a6e799Ssimonb 1951*e4a6e799Ssimonb LESSANSIMIDCHARS 1952*e4a6e799Ssimonb Characters which may appear between the ESC character and the 1953*e4a6e799Ssimonb end character in an ANSI color escape sequence (default 1954*e4a6e799Ssimonb "0123456789:;[?!"'#%()*+ ". 1955*e4a6e799Ssimonb 1956*e4a6e799Ssimonb LESSBINFMT 1957*e4a6e799Ssimonb Format for displaying non-printable, non-control characters. 1958*e4a6e799Ssimonb 1959*e4a6e799Ssimonb LESSCHARDEF 1960*e4a6e799Ssimonb Defines a character set. 1961*e4a6e799Ssimonb 1962*e4a6e799Ssimonb LESSCHARSET 1963*e4a6e799Ssimonb Selects a predefined character set. 1964*e4a6e799Ssimonb 1965*e4a6e799Ssimonb LESSCLOSE 1966*e4a6e799Ssimonb Command line to invoke the (optional) input-postprocessor. 1967*e4a6e799Ssimonb 1968*e4a6e799Ssimonb LESSECHO 1969*e4a6e799Ssimonb Name of the lessecho program (default "lessecho"). The lessecho 1970*e4a6e799Ssimonb program is needed to expand metacharacters, such as * and ?, in 1971*e4a6e799Ssimonb filenames on Unix systems. 1972*e4a6e799Ssimonb 1973*e4a6e799Ssimonb LESSEDIT 1974*e4a6e799Ssimonb Editor prototype string (used for the v command). See discus‐ 1975*e4a6e799Ssimonb sion under PROMPTS. 1976*e4a6e799Ssimonb 1977*e4a6e799Ssimonb LESSGLOBALTAGS 1978*e4a6e799Ssimonb Name of the command used by the -t option to find global tags. 1979*e4a6e799Ssimonb Normally should be set to "global" if your system has the [1mglob‐[0m 1980*e4a6e799Ssimonb [1mal[22m(1) command. If not set, global tags are not used. 1981*e4a6e799Ssimonb 1982*e4a6e799Ssimonb LESSHISTFILE 1983*e4a6e799Ssimonb Name of the history file used to remember search commands and 1984*e4a6e799Ssimonb shell commands between invocations of [1mless[22m. If set to "-" or 1985*e4a6e799Ssimonb "/dev/null", a history file is not used. The default depends on 1986*e4a6e799Ssimonb the operating system, but is usually: 1987*e4a6e799Ssimonb 1988*e4a6e799Ssimonb Linux and Unix 1989*e4a6e799Ssimonb "$XDG_STATE_HOME/lesshst" or "$HOME/.local/state/lesshst" 1990*e4a6e799Ssimonb or "$XDG_DATA_HOME/lesshst" or "$HOME/.lesshst". 1991*e4a6e799Ssimonb 1992*e4a6e799Ssimonb Windows and MS-DOS 1993*e4a6e799Ssimonb "$HOME/_lesshst". 1994*e4a6e799Ssimonb 1995*e4a6e799Ssimonb OS/2 "$HOME/lesshst.ini" or "$INIT/lesshst.ini". 1996*e4a6e799Ssimonb 1997*e4a6e799Ssimonb LESSHISTSIZE 1998*e4a6e799Ssimonb The maximum number of commands to save in the history file. The 1999*e4a6e799Ssimonb default is 100. 2000*e4a6e799Ssimonb 2001*e4a6e799Ssimonb LESSKEYIN 2002*e4a6e799Ssimonb Name of the default [4mlesskey[24m [4msource[24m file. 2003*e4a6e799Ssimonb 2004*e4a6e799Ssimonb LESSKEY 2005*e4a6e799Ssimonb Name of the default [4mlesskey[24m [4mbinary[24m file. (Not used if 2006*e4a6e799Ssimonb "$LESSKEYIN" exists.) 2007*e4a6e799Ssimonb 2008*e4a6e799Ssimonb LESSKEYIN_SYSTEM 2009*e4a6e799Ssimonb Name of the default system-wide [4mlesskey[24m [4msource[24m file. 2010*e4a6e799Ssimonb 2011*e4a6e799Ssimonb LESSKEY_SYSTEM 2012*e4a6e799Ssimonb Name of the default system-wide [4mlesskey[24m [4mbinary[24m file. (Not used 2013*e4a6e799Ssimonb if "$LESSKEYIN_SYSTEM" exists.) 2014*e4a6e799Ssimonb 2015*e4a6e799Ssimonb LESSMETACHARS 2016*e4a6e799Ssimonb List of characters which are considered "metacharacters" by the 2017*e4a6e799Ssimonb shell. 2018*e4a6e799Ssimonb 2019*e4a6e799Ssimonb LESSMETAESCAPE 2020*e4a6e799Ssimonb Prefix which less will add before each metacharacter in a com‐ 2021*e4a6e799Ssimonb mand sent to the shell. If LESSMETAESCAPE is an empty string, 2022*e4a6e799Ssimonb commands containing metacharacters will not be passed to the 2023*e4a6e799Ssimonb shell. 2024*e4a6e799Ssimonb 2025*e4a6e799Ssimonb LESSOPEN 2026*e4a6e799Ssimonb Command line to invoke the (optional) input-preprocessor. 2027*e4a6e799Ssimonb 2028*e4a6e799Ssimonb LESSSECURE 2029*e4a6e799Ssimonb Runs less in "secure" mode. See discussion under SECURITY. 2030*e4a6e799Ssimonb 2031*e4a6e799Ssimonb LESSSEPARATOR 2032*e4a6e799Ssimonb String to be appended to a directory name in filename comple‐ 2033*e4a6e799Ssimonb tion. 2034*e4a6e799Ssimonb 2035*e4a6e799Ssimonb LESSUTFBINFMT 2036*e4a6e799Ssimonb Format for displaying non-printable Unicode code points. 2037*e4a6e799Ssimonb 2038*e4a6e799Ssimonb LESSUTFCHARDEF 2039*e4a6e799Ssimonb Overrides the type of specified Unicode characters. 2040*e4a6e799Ssimonb 2041*e4a6e799Ssimonb LESS_COLUMNS 2042*e4a6e799Ssimonb Sets the number of columns on the screen. Unlike COLUMNS, takes 2043*e4a6e799Ssimonb precedence over the system's idea of the screen size, so it can 2044*e4a6e799Ssimonb be used to make [1mless [22muse less than the full screen width. If 2045*e4a6e799Ssimonb set to a negative number, sets the number of columns used to 2046*e4a6e799Ssimonb this much less than the actual screen width. 2047*e4a6e799Ssimonb 2048*e4a6e799Ssimonb LESS_LINES 2049*e4a6e799Ssimonb Sets the number of lines on the screen. Unlike LINES, takes 2050*e4a6e799Ssimonb precedence over the system's idea of the screen size, so it can 2051*e4a6e799Ssimonb be used to make [1mless [22muse less than the full screen height. If 2052*e4a6e799Ssimonb set to a negative number, sets the number of lines used to this 2053*e4a6e799Ssimonb much less than the actual screen height. When set, [1mless [22mre‐ 2054*e4a6e799Ssimonb paints the entire screen on every movement command, so scrolling 2055*e4a6e799Ssimonb may be slower. 2056*e4a6e799Ssimonb 2057*e4a6e799Ssimonb LESS_DATA_DELAY 2058*e4a6e799Ssimonb Duration (in milliseconds) after starting to read data from the 2059*e4a6e799Ssimonb input, after which the "Waiting for data" message will be dis‐ 2060*e4a6e799Ssimonb played. The default is 4000 (4 seconds). 2061*e4a6e799Ssimonb 2062*e4a6e799Ssimonb LESS_IS_MORE 2063*e4a6e799Ssimonb Emulate the [1mmore[22m(1) command. 2064*e4a6e799Ssimonb 2065*e4a6e799Ssimonb LESS_TERMCAP_xx 2066*e4a6e799Ssimonb Where "xx" is any two characters, overrides the definition of 2067*e4a6e799Ssimonb the termcap "xx" capability for the terminal. 2068*e4a6e799Ssimonb 2069*e4a6e799Ssimonb LINES Sets the number of lines on the screen. Takes precedence over 2070*e4a6e799Ssimonb the number of lines specified by the TERM variable. (But if you 2071*e4a6e799Ssimonb have a windowing system which supports TIOCGWINSZ or WIOCGETD, 2072*e4a6e799Ssimonb the window system's idea of the screen size takes precedence 2073*e4a6e799Ssimonb over the LINES and COLUMNS environment variables.) 2074*e4a6e799Ssimonb 2075*e4a6e799Ssimonb MORE Options which are passed to [1mless [22mautomatically when running in 2076*e4a6e799Ssimonb [1mmore[22m-compatible mode. 2077*e4a6e799Ssimonb 2078*e4a6e799Ssimonb PATH User's search path (used to find a lesskey file on MS-DOS and 2079*e4a6e799Ssimonb OS/2 systems). 2080*e4a6e799Ssimonb 2081*e4a6e799Ssimonb SHELL The shell used to execute the ! command, as well as to expand 2082*e4a6e799Ssimonb filenames. 2083*e4a6e799Ssimonb 2084*e4a6e799Ssimonb TERM The type of terminal on which [1mless [22mis being run. 2085*e4a6e799Ssimonb 2086*e4a6e799Ssimonb VISUAL The name of the editor (used for the v command). 2087*e4a6e799Ssimonb 2088*e4a6e799Ssimonb XDG_CONFIG_HOME 2089*e4a6e799Ssimonb Possible location of the [1mlesskey [22mfile; see the KEY BINDINGS sec‐ 2090*e4a6e799Ssimonb tion. 2091*e4a6e799Ssimonb 2092*e4a6e799Ssimonb XDG_DATA_HOME 2093*e4a6e799Ssimonb Possible location of the history file; see the description of 2094*e4a6e799Ssimonb the LESSHISTFILE environment variable. 2095*e4a6e799Ssimonb 2096*e4a6e799Ssimonb XDG_STATE_HOME 2097*e4a6e799Ssimonb Possible location of the history file; see the description of 2098*e4a6e799Ssimonb the LESSHISTFILE environment variable. 2099*e4a6e799Ssimonb 2100*e4a6e799Ssimonb[1mSEE ALSO[0m 2101*e4a6e799Ssimonb [1mlesskey[22m(1), [1mlessecho[22m(1) 2102*e4a6e799Ssimonb 2103*e4a6e799Ssimonb[1mCOPYRIGHT[0m 2104*e4a6e799Ssimonb Copyright (C) 1984-2023 Mark Nudelman 2105*e4a6e799Ssimonb 2106*e4a6e799Ssimonb less is part of the GNU project and is free software. You can redis‐ 2107*e4a6e799Ssimonb tribute it and/or modify it under the terms of either (1) the GNU Gen‐ 2108*e4a6e799Ssimonb eral Public License as published by the Free Software Foundation; or 2109*e4a6e799Ssimonb (2) the Less License. See the file README in the less distribution for 2110*e4a6e799Ssimonb more details regarding redistribution. You should have received a copy 2111*e4a6e799Ssimonb of the GNU General Public License along with the source for less; see 2112*e4a6e799Ssimonb the file COPYING. If not, write to the Free Software Foundation, 59 2113*e4a6e799Ssimonb Temple Place, Suite 330, Boston, MA 02111-1307, USA. You should also 2114*e4a6e799Ssimonb have received a copy of the Less License; see the file LICENSE. 2115*e4a6e799Ssimonb 2116*e4a6e799Ssimonb less is distributed in the hope that it will be useful, but WITHOUT ANY 2117*e4a6e799Ssimonb WARRANTY; without even the implied warranty of MERCHANTABILITY or FIT‐ 2118*e4a6e799Ssimonb NESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 2119*e4a6e799Ssimonb more details. 2120*e4a6e799Ssimonb 2121*e4a6e799Ssimonb[1mAUTHOR[0m 2122*e4a6e799Ssimonb Mark Nudelman 2123*e4a6e799Ssimonb Report bugs at https://github.com/gwsw/less/issues. 2124*e4a6e799Ssimonb For more information, see the less homepage at 2125*e4a6e799Ssimonb https://greenwoodsoftware.com/less 2126*e4a6e799Ssimonb 2127*e4a6e799Ssimonb 2128*e4a6e799Ssimonb 2129*e4a6e799Ssimonb Version 643: 20 Jul 2023 LESS(1) 2130