{"id":333,"date":"2019-10-21T19:48:29","date_gmt":"2019-10-21T17:48:29","guid":{"rendered":"http:\/\/linuxboxen2.dk\/?p=333"},"modified":"2019-10-21T19:48:29","modified_gmt":"2019-10-21T17:48:29","slug":"org_less","status":"publish","type":"post","link":"https:\/\/www.linuxboxen.dk\/?p=333","title":{"rendered":"LESS"},"content":{"rendered":"<p>LESS(1)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 General Commands Manual\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 LESS(1)<\/p>\n<p>NAME<\/p>\n<p>less &#8211; opposite of more<\/p>\n<p>SYNOPSIS<\/p>\n<p>less -?<br \/>\nless &#8211;help<br \/>\nless -V<br \/>\nless &#8211;version<br \/>\nless [-[+]aABcCdeEfFgGiIJKLmMnNqQrRsSuUVwWX~]<br \/>\n[-b space] [-h lines] [-j line] [-k keyfile]<br \/>\n[-{oO} logfile] [-p pattern] [-P prompt] [-t tag]<br \/>\n[-T tagsfile] [-x tab,&#8230;] [-y lines] [-[z] lines]<br \/>\n[-# shift] [+[+]cmd] [&#8211;] [filename]&#8230;<br \/>\n(See the OPTIONS section for alternate option syntax with long option<br \/>\nnames.)<\/p>\n<p>DESCRIPTION<\/p>\n<p>Less is a program similar to more (1), but which allows backward<br \/>\nmovement in the file as well as forward movement.\u00a0 Also, less does<br \/>\nnot have to read the entire input file before starting, so with large<br \/>\ninput files it starts up faster than text editors like vi (1).\u00a0 Less<br \/>\nuses termcap (or terminfo on some systems), so it can run on a<br \/>\nvariety of terminals.\u00a0 There is even limited support for hardcopy<br \/>\nterminals.\u00a0 (On a hardcopy terminal, lines which should be printed at<br \/>\nthe top of the screen are prefixed with a caret.)<\/p>\n<p>Commands are based on both more and vi.\u00a0 Commands may be preceded by<br \/>\na decimal number, called N in the descriptions below.\u00a0 The number is<br \/>\nused by some commands, as indicated.<\/p>\n<p>COMMANDS<\/p>\n<p>In the following descriptions, ^X means control-X.\u00a0 ESC stands for<br \/>\nthe ESCAPE key; for example ESC-v means the two character sequence<br \/>\n&#8220;ESCAPE&#8221;, then &#8220;v&#8221;.<\/p>\n<p>h or H Help: display a summary of these commands.\u00a0 If you forget all<br \/>\nthe other commands, remember this one.<\/p>\n<p>SPACE or ^V or f or ^F<br \/>\nScroll forward N lines, default one window (see option -z<br \/>\nbelow).\u00a0 If N is more than the screen size, only the final<br \/>\nscreenful is displayed.\u00a0 Warning: some systems use ^V as a<br \/>\nspecial literalization character.<\/p>\n<p>z\u00a0\u00a0\u00a0\u00a0\u00a0 Like SPACE, but if N is specified, it becomes the new window<br \/>\nsize.<\/p>\n<p>ESC-SPACE<br \/>\nLike SPACE, but scrolls a full screenful, even if it reaches<br \/>\nend-of-file in the process.<\/p>\n<p>ENTER or RETURN or ^N or e or ^E or j or ^J<br \/>\nScroll forward N lines, default 1.\u00a0 The entire N lines are<br \/>\ndisplayed, even if N is more than the screen size.<\/p>\n<p>d or ^D<br \/>\nScroll forward N lines, default one half of the screen size.<br \/>\nIf N is specified, it becomes the new default for subsequent d<br \/>\nand u commands.<\/p>\n<p>b or ^B or ESC-v<br \/>\nScroll backward N lines, default one window (see option -z<br \/>\nbelow).\u00a0 If N is more than the screen size, only the final<br \/>\nscreenful is displayed.<\/p>\n<p>w\u00a0\u00a0\u00a0\u00a0\u00a0 Like ESC-v, but if N is specified, it becomes the new window<br \/>\nsize.<\/p>\n<p>y or ^Y or ^P or k or ^K<br \/>\nScroll backward N lines, default 1.\u00a0 The entire N lines are<br \/>\ndisplayed, even if N is more than the screen size.\u00a0 Warning:<br \/>\nsome systems use ^Y as a special job control character.<\/p>\n<p>u or ^U<br \/>\nScroll backward N lines, default one half of the screen size.<br \/>\nIf N is specified, it becomes the new default for subsequent d<br \/>\nand u commands.<\/p>\n<p>ESC-) or RIGHTARROW<br \/>\nScroll horizontally right N characters, default half the<br \/>\nscreen width (see the -# option).\u00a0 If a number N is specified,<br \/>\nit becomes the default for future RIGHTARROW and LEFTARROW<br \/>\ncommands.\u00a0 While the text is scrolled, it acts as though the<br \/>\n-S option (chop lines) were in effect.<\/p>\n<p>ESC-( or LEFTARROW<br \/>\nScroll horizontally left N characters, default half the screen<br \/>\nwidth (see the -# option).\u00a0 If a number N is specified, it<br \/>\nbecomes the default for future RIGHTARROW and LEFTARROW<br \/>\ncommands.<\/p>\n<p>r or ^R or ^L<br \/>\nRepaint the screen.<\/p>\n<p>R\u00a0\u00a0\u00a0\u00a0\u00a0 Repaint the screen, discarding any buffered input.\u00a0 Useful if<br \/>\nthe file is changing while it is being viewed.<\/p>\n<p>F\u00a0\u00a0\u00a0\u00a0\u00a0 Scroll forward, and keep trying to read when the end of file<br \/>\nis reached.\u00a0 Normally this command would be used when already<br \/>\nat the end of the file.\u00a0 It is a way to monitor the tail of a<br \/>\nfile which is growing while it is being viewed.\u00a0 (The behavior<br \/>\nis similar to the &#8220;tail -f&#8221; command.)<\/p>\n<p>ESC-F\u00a0 Like F, but as soon as a line is found which matches the last<br \/>\nsearch pattern, the terminal bell is rung and forward<br \/>\nscrolling stops.<\/p>\n<p>g or &lt; or ESC-&lt;<br \/>\nGo to line N in the file, default 1 (beginning of file).<br \/>\n(Warning: this may be slow if N is large.)<\/p>\n<p>G or &gt; or ESC-&gt;<br \/>\nGo to line N in the file, default the end of the file.<br \/>\n(Warning: this may be slow if N is large, or if N is not<br \/>\nspecified and standard input, rather than a file, is being<br \/>\nread.)<\/p>\n<p>p or % Go to a position N percent into the file.\u00a0 N should be between<br \/>\n0 and 100, and may contain a decimal point.<\/p>\n<p>P\u00a0\u00a0\u00a0\u00a0\u00a0 Go to the line containing byte offset N in the file.<\/p>\n<p>{\u00a0\u00a0\u00a0\u00a0\u00a0 If a left curly bracket appears in the top line displayed on<br \/>\nthe screen, the { command will go to the matching right curly<br \/>\nbracket.\u00a0 The matching right curly bracket is positioned on<br \/>\nthe bottom line of the screen.\u00a0 If there is more than one left<br \/>\ncurly bracket on the top line, a number N may be used to<br \/>\nspecify the N-th bracket on the line.<\/p>\n<p>}\u00a0\u00a0\u00a0\u00a0\u00a0 If a right curly bracket appears in the bottom line displayed<br \/>\non the screen, the } command will go to the matching left<br \/>\ncurly bracket.\u00a0 The matching left curly bracket is positioned<br \/>\non the top line of the screen.\u00a0 If there is more than one<br \/>\nright curly bracket on the top line, a number N may be used to<br \/>\nspecify the N-th bracket on the line.<\/p>\n<p>(\u00a0\u00a0\u00a0\u00a0\u00a0 Like {, but applies to parentheses rather than curly brackets.<\/p>\n<p>)\u00a0\u00a0\u00a0\u00a0\u00a0 Like }, but applies to parentheses rather than curly brackets.<\/p>\n<p>[\u00a0\u00a0\u00a0\u00a0\u00a0 Like {, but applies to square brackets rather than curly<br \/>\nbrackets.<\/p>\n<p>]\u00a0\u00a0\u00a0\u00a0\u00a0 Like }, but applies to square brackets rather than curly<br \/>\nbrackets.<\/p>\n<p>ESC-^F Followed by two characters, acts like {, but uses the two<br \/>\ncharacters as open and close brackets, respectively.\u00a0 For<br \/>\nexample, &#8220;ESC ^F &lt; &gt;&#8221; could be used to go forward to the &gt;<br \/>\nwhich matches the &lt; in the top displayed line.<\/p>\n<p>ESC-^B Followed by two characters, acts like }, but uses the two<br \/>\ncharacters as open and close brackets, respectively.\u00a0 For<br \/>\nexample, &#8220;ESC ^B &lt; &gt;&#8221; could be used to go backward to the &lt;<br \/>\nwhich matches the &gt; in the bottom displayed line.<\/p>\n<p>m\u00a0\u00a0\u00a0\u00a0\u00a0 Followed by any lowercase letter, marks the current position<br \/>\nwith that letter.<\/p>\n<p>&#8216;\u00a0\u00a0\u00a0\u00a0\u00a0 (Single quote.)\u00a0 Followed by any lowercase letter, returns to<br \/>\nthe position which was previously marked with that letter.<br \/>\nFollowed by another single quote, returns to the position at<br \/>\nwhich the last &#8220;large&#8221; movement command was executed.<br \/>\nFollowed by a ^ or $, jumps to the beginning or end of the<br \/>\nfile respectively.\u00a0 Marks are preserved when a new file is<br \/>\nexamined, so the &#8216; command can be used to switch between input<br \/>\nfiles.<\/p>\n<p>^X^X\u00a0\u00a0 Same as single quote.<\/p>\n<p>\/pattern<br \/>\nSearch forward in the file for the N-th line containing the<br \/>\npattern.\u00a0 N defaults to 1.\u00a0 The pattern is a regular<br \/>\nexpression, as recognized by the regular expression library<br \/>\nsupplied by your system.\u00a0 The search starts at the first line<br \/>\ndisplayed (but see the -a and -j options, which change this).<\/p>\n<p>Certain characters are special if entered at the beginning of<br \/>\nthe pattern; they modify the type of search rather than become<br \/>\npart of the pattern:<\/p>\n<p>^N or !<br \/>\nSearch for lines which do NOT match the pattern.<\/p>\n<p>^E or *<br \/>\nSearch multiple files.\u00a0 That is, if the search reaches<br \/>\nthe END of the current file without finding a match,<br \/>\nthe search continues in the next file in the command<br \/>\nline list.<\/p>\n<p>^F or @<br \/>\nBegin the search at the first line of the FIRST file in<br \/>\nthe command line list, regardless of what is currently<br \/>\ndisplayed on the screen or the settings of the -a or -j<br \/>\noptions.<\/p>\n<p>^K\u00a0\u00a0\u00a0\u00a0 Highlight any text which matches the pattern on the<br \/>\ncurrent screen, but don&#8217;t move to the first match (KEEP<br \/>\ncurrent position).<\/p>\n<p>^R\u00a0\u00a0\u00a0\u00a0 Don&#8217;t interpret regular expression metacharacters; that<br \/>\nis, do a simple textual comparison.<\/p>\n<p>?pattern<br \/>\nSearch backward in the file for the N-th line containing the<br \/>\npattern.\u00a0 The search starts at the line immediately before the<br \/>\ntop line displayed.<\/p>\n<p>Certain characters are special as in the \/ command:<\/p>\n<p>^N or !<br \/>\nSearch for lines which do NOT match the pattern.<\/p>\n<p>^E or *<br \/>\nSearch multiple files.\u00a0 That is, if the search reaches<br \/>\nthe beginning of the current file without finding a<br \/>\nmatch, the search continues in the previous file in the<br \/>\ncommand line list.<\/p>\n<p>^F or @<br \/>\nBegin the search at the last line of the last file in<br \/>\nthe command line list, regardless of what is currently<br \/>\ndisplayed on the screen or the settings of the -a or -j<br \/>\noptions.<\/p>\n<p>^K\u00a0\u00a0\u00a0\u00a0 As in forward searches.<\/p>\n<p>^R\u00a0\u00a0\u00a0\u00a0 As in forward searches.<\/p>\n<p>ESC-\/pattern<br \/>\nSame as &#8220;\/*&#8221;.<\/p>\n<p>ESC-?pattern<br \/>\nSame as &#8220;?*&#8221;.<\/p>\n<p>n\u00a0\u00a0\u00a0\u00a0\u00a0 Repeat previous search, for N-th line containing the last<br \/>\npattern.\u00a0 If the previous search was modified by ^N, the<br \/>\nsearch is made for the N-th line NOT containing the pattern.<br \/>\nIf the previous search was modified by ^E, the search<br \/>\ncontinues in the next (or previous) file if not satisfied in<br \/>\nthe current file.\u00a0 If the previous search was modified by ^R,<br \/>\nthe search is done without using regular expressions.\u00a0 There<br \/>\nis no effect if the previous search was modified by ^F or ^K.<\/p>\n<p>N\u00a0\u00a0\u00a0\u00a0\u00a0 Repeat previous search, but in the reverse direction.<\/p>\n<p>ESC-n\u00a0 Repeat previous search, but crossing file boundaries.\u00a0 The<br \/>\neffect is as if the previous search were modified by *.<\/p>\n<p>ESC-N\u00a0 Repeat previous search, but in the reverse direction and<br \/>\ncrossing file boundaries.<\/p>\n<p>ESC-u\u00a0 Undo search highlighting.\u00a0 Turn off highlighting of strings<br \/>\nmatching the current search pattern.\u00a0 If highlighting is<br \/>\nalready off because of a previous ESC-u command, turn<br \/>\nhighlighting back on.\u00a0 Any search command will also turn<br \/>\nhighlighting back on.\u00a0 (Highlighting can also be disabled by<br \/>\ntoggling the -G option; in that case search commands do not<br \/>\nturn highlighting back on.)<\/p>\n<p>&amp;pattern<br \/>\nDisplay only lines which match the pattern; lines which do not<br \/>\nmatch the pattern are not displayed.\u00a0 If pattern is empty (if<br \/>\nyou type &amp; immediately followed by ENTER), any filtering is<br \/>\nturned off, and all lines are displayed.\u00a0 While filtering is<br \/>\nin effect, an ampersand is displayed at the beginning of the<br \/>\nprompt, as a reminder that some lines in the file may be<br \/>\nhidden.<\/p>\n<p>Certain characters are special as in the \/ command:<\/p>\n<p>^N or !<br \/>\nDisplay only lines which do NOT match the pattern.<\/p>\n<p>^R\u00a0\u00a0\u00a0\u00a0 Don&#8217;t interpret regular expression metacharacters; that<br \/>\nis, do a simple textual comparison.<\/p>\n<p>:e [filename]<br \/>\nExamine a new file.\u00a0 If the filename is missing, the &#8220;current&#8221;<br \/>\nfile (see the :n and :p commands below) from the list of files<br \/>\nin the command line is re-examined.\u00a0 A percent sign (%) in the<br \/>\nfilename is replaced by the name of the current file.\u00a0 A pound<br \/>\nsign (#) is replaced by the name of the previously examined<br \/>\nfile.\u00a0 However, two consecutive percent signs are simply<br \/>\nreplaced with a single percent sign.\u00a0 This allows you to enter<br \/>\na filename that contains a percent sign in the name.<br \/>\nSimilarly, two consecutive pound signs are replaced with a<br \/>\nsingle pound sign.\u00a0 The filename is inserted into the command<br \/>\nline list of files so that it can be seen by subsequent :n and<br \/>\n:p commands.\u00a0 If the filename consists of several files, they<br \/>\nare all inserted into the list of files and the first one is<br \/>\nexamined.\u00a0 If the filename contains one or more spaces, the<br \/>\nentire filename should be enclosed in double quotes (also see<br \/>\nthe -&#8221; option).<\/p>\n<p>^X^V or E<br \/>\nSame as :e.\u00a0 Warning: some systems use ^V as a special<br \/>\nliteralization character.\u00a0 On such systems, you may not be<br \/>\nable to use ^V.<\/p>\n<p>:n\u00a0\u00a0\u00a0\u00a0 Examine the next file (from the list of files given in the<br \/>\ncommand line).\u00a0 If a number N is specified, the N-th next file<br \/>\nis examined.<\/p>\n<p>:p\u00a0\u00a0\u00a0\u00a0 Examine the previous file in the command line list.\u00a0 If a<br \/>\nnumber N is specified, the N-th previous file is examined.<\/p>\n<p>\ud83d\ude21\u00a0\u00a0\u00a0\u00a0 Examine the first file in the command line list.\u00a0 If a number<br \/>\nN is specified, the N-th file in the list is examined.<\/p>\n<p>:d\u00a0\u00a0\u00a0\u00a0 Remove the current file from the list of files.<\/p>\n<p>t\u00a0\u00a0\u00a0\u00a0\u00a0 Go to the next tag, if there were more than one matches for<br \/>\nthe current tag.\u00a0 See the -t option for more details about<br \/>\ntags.<\/p>\n<p>T\u00a0\u00a0\u00a0\u00a0\u00a0 Go to the previous tag, if there were more than one matches<br \/>\nfor the current tag.<\/p>\n<p>= or ^G or :f<br \/>\nPrints some information about the file being viewed, including<br \/>\nits name and the line number and byte offset of the bottom<br \/>\nline being displayed.\u00a0 If possible, it also prints the length<br \/>\nof the file, the number of lines in the file and the percent<br \/>\nof the file above the last displayed line.<\/p>\n<p>&#8211;\u00a0\u00a0\u00a0\u00a0\u00a0 Followed by one of the command line option letters (see<br \/>\nOPTIONS below), this will change the setting of that option<br \/>\nand print a message describing the new setting.\u00a0 If a ^P<br \/>\n(CONTROL-P) is entered immediately after the dash, the setting<br \/>\nof the option is changed but no message is printed.\u00a0 If the<br \/>\noption letter has a numeric value (such as -b or -h), or a<br \/>\nstring value (such as -P or -t), a new value may be entered<br \/>\nafter the option letter.\u00a0 If no new value is entered, a<br \/>\nmessage describing the current setting is printed and nothing<br \/>\nis changed.<\/p>\n<p>&#8212;\u00a0\u00a0\u00a0\u00a0 Like the &#8211; command, but takes a long option name (see OPTIONS<br \/>\nbelow) rather than a single option letter.\u00a0 You must press<br \/>\nENTER or RETURN after typing the option name.\u00a0 A ^P<br \/>\nimmediately after the second dash suppresses printing of a<br \/>\nmessage describing the new setting, as in the &#8211; command.<\/p>\n<p>-+\u00a0\u00a0\u00a0\u00a0 Followed by one of the command line option letters this will<br \/>\nreset the option to its default setting and print a message<br \/>\ndescribing the new setting.\u00a0 (The &#8220;-+X&#8221; command does the same<br \/>\nthing as &#8220;-+X&#8221; on the command line.)\u00a0 This does not work for<br \/>\nstring-valued options.<\/p>\n<p>&#8211;+\u00a0\u00a0\u00a0 Like the -+ command, but takes a long option name rather than<br \/>\na single option letter.<\/p>\n<p>-!\u00a0\u00a0\u00a0\u00a0 Followed by one of the command line option letters, this will<br \/>\nreset the option to the &#8220;opposite&#8221; of its default setting and<br \/>\nprint a message describing the new setting.\u00a0 This does not<br \/>\nwork for numeric or string-valued options.<\/p>\n<p>&#8211;!\u00a0\u00a0\u00a0 Like the -! command, but takes a long option name rather than<br \/>\na single option letter.<\/p>\n<p>_\u00a0\u00a0\u00a0\u00a0\u00a0 (Underscore.)\u00a0 Followed by one of the command line option<br \/>\nletters, this will print a message describing the current<br \/>\nsetting of that option.\u00a0 The setting of the option is not<br \/>\nchanged.<\/p>\n<p>__\u00a0\u00a0\u00a0\u00a0 (Double underscore.)\u00a0 Like the _ (underscore) command, but<br \/>\ntakes a long option name rather than a single option letter.<br \/>\nYou must press ENTER or RETURN after typing the option name.<\/p>\n<p>+cmd\u00a0\u00a0 Causes the specified cmd to be executed each time a new file<br \/>\nis examined.\u00a0 For example, +G causes less to initially display<br \/>\neach file starting at the end rather than the beginning.<\/p>\n<p>V\u00a0\u00a0\u00a0\u00a0\u00a0 Prints the version number of less being run.<\/p>\n<p>q or Q or :q or :Q or ZZ<br \/>\nExits less.<\/p>\n<p>The following four commands may or may not be valid, depending on<br \/>\nyour particular installation.<\/p>\n<p>v\u00a0\u00a0\u00a0\u00a0\u00a0 Invokes an editor to edit the current file being viewed.\u00a0 The<br \/>\neditor is taken from the environment variable VISUAL if<br \/>\ndefined, or EDITOR if VISUAL is not defined, or defaults to<br \/>\n&#8220;vi&#8221; if neither VISUAL nor EDITOR is defined.\u00a0 See also the<br \/>\ndiscussion of LESSEDIT under the section on PROMPTS below.<\/p>\n<p>! shell-command<br \/>\nInvokes a shell to run the shell-command given.\u00a0 A percent<br \/>\nsign (%) in the command is replaced by the name of the current<br \/>\nfile.\u00a0 A pound sign (#) is replaced by the name of the<br \/>\npreviously examined file.\u00a0 &#8220;!!&#8221; repeats the last shell<br \/>\ncommand.\u00a0 &#8220;!&#8221; with no shell command simply invokes a shell.<br \/>\nOn Unix systems, the shell is taken from the environment<br \/>\nvariable SHELL, or defaults to &#8220;sh&#8221;.\u00a0 On MS-DOS and OS\/2<br \/>\nsystems, the shell is the normal command processor.<\/p>\n<p>| &lt;m&gt; shell-command<br \/>\n&lt;m&gt; represents any mark letter.\u00a0 Pipes a section of the input<br \/>\nfile to the given shell command.\u00a0 The section of the file to<br \/>\nbe piped is between the first line on the current screen and<br \/>\nthe position marked by the letter.\u00a0 &lt;m&gt; may also be ^ or $ to<br \/>\nindicate beginning or end of file respectively.\u00a0 If &lt;m&gt; is .<br \/>\nor newline, the current screen is piped.<\/p>\n<p>s filename<br \/>\nSave the input to a file.\u00a0 This only works if the input is a<br \/>\npipe, not an ordinary file.<\/p>\n<p>OPTIONS<\/p>\n<p>Command line options are described below.\u00a0 Most options may be<br \/>\nchanged while less is running, via the &#8220;-&#8221; command.<\/p>\n<p>Most options may be given in one of two forms: either a dash followed<br \/>\nby a single letter, or two dashes followed by a long option name.\u00a0 A<br \/>\nlong option name may be abbreviated as long as the abbreviation is<br \/>\nunambiguous.\u00a0 For example, &#8211;quit-at-eof may be abbreviated &#8211;quit,<br \/>\nbut not &#8211;qui, since both &#8211;quit-at-eof and &#8211;quiet begin with &#8211;qui.<br \/>\nSome long option names are in uppercase, such as &#8211;QUIT-AT-EOF, as<br \/>\ndistinct from &#8211;quit-at-eof.\u00a0 Such option names need only have their<br \/>\nfirst letter capitalized; the remainder of the name may be in either<br \/>\ncase.\u00a0 For example, &#8211;Quit-at-eof is equivalent to &#8211;QUIT-AT-EOF.<\/p>\n<p>Options are also taken from the environment variable &#8220;LESS&#8221;.\u00a0 For<br \/>\nexample, to avoid typing &#8220;less -options &#8230;&#8221; each time less is<br \/>\ninvoked, you might tell csh:<\/p>\n<p>setenv LESS &#8220;-options&#8221;<\/p>\n<p>or if you use sh:<\/p>\n<p>LESS=&#8221;-options&#8221;; export LESS<\/p>\n<p>On MS-DOS, you don&#8217;t need the quotes, but you should replace any<br \/>\npercent signs in the options string by double percent signs.<\/p>\n<p>The environment variable is parsed before the command line, so<br \/>\ncommand line options override the LESS environment variable.\u00a0 If an<br \/>\noption appears in the LESS variable, it can be reset to its default<br \/>\nvalue on the command line by beginning the command line option with<br \/>\n&#8220;-+&#8221;.<\/p>\n<p>Some options like -k or -D require a string to follow the option<br \/>\nletter.\u00a0 The string for that option is considered to end when a<br \/>\ndollar sign ($) is found.\u00a0 For example, you can set two -D options on<br \/>\nMS-DOS like this:<\/p>\n<p>LESS=&#8221;Dn9.1$Ds4.1&#8243;<\/p>\n<p>If the &#8211;use-backslash option appears earlier in the options, then a<br \/>\ndollar sign or backslash may be included literally in an option<br \/>\nstring by preceding it with a backslash.\u00a0 If the &#8211;use-backslash<br \/>\noption is not in effect, then backslashes are not treated specially,<br \/>\nand there is no way to include a dollar sign in the option string.<\/p>\n<p>-? or &#8211;help<br \/>\nThis option displays a summary of the commands accepted by<br \/>\nless (the same as the h command).\u00a0 (Depending on how your<br \/>\nshell interprets the question mark, it may be necessary to<br \/>\nquote the question mark, thus: &#8220;-\\?&#8221;.)<\/p>\n<p>-a or &#8211;search-skip-screen<br \/>\nBy default, forward searches start at the top of the displayed<br \/>\nscreen and backwards searches start at the bottom of the<br \/>\ndisplayed screen (except for repeated searches invoked by the<br \/>\nn or N commands, which start after or before the &#8220;target&#8221; line<br \/>\nrespectively; see the -j option for more about the target<br \/>\nline).\u00a0 The -a option causes forward searches to instead start<br \/>\nat the bottom of the screen and backward searches to start at<br \/>\nthe top of the screen, thus skipping all lines displayed on<br \/>\nthe screen.<\/p>\n<p>-A or &#8211;SEARCH-SKIP-SCREEN<br \/>\nCauses all forward searches (not just non-repeated searches)<br \/>\nto start just after the target line, and all backward searches<br \/>\nto start just before the target line.\u00a0 Thus, forward searches<br \/>\nwill skip part of the displayed screen (from the first line up<br \/>\nto and including the target line).\u00a0 Similarly backwards<br \/>\nsearches will skip the displayed screen from the last line up<br \/>\nto and including the target line.\u00a0 This was the default<br \/>\nbehavior in less versions prior to 441.<\/p>\n<p>-bn or &#8211;buffers=n<br \/>\nSpecifies the amount of buffer space less will use for each<br \/>\nfile, in units of kilobytes (1024 bytes).\u00a0 By default 64K of<br \/>\nbuffer space is used for each file (unless the file is a pipe;<br \/>\nsee the -B option).\u00a0 The -b option specifies instead that n<br \/>\nkilobytes of buffer space should be used for each file.\u00a0 If n<br \/>\nis -1, buffer space is unlimited; that is, the entire file can<br \/>\nbe read into memory.<\/p>\n<p>-B or &#8211;auto-buffers<br \/>\nBy default, when data is read from a pipe, buffers are<br \/>\nallocated automatically as needed.\u00a0 If a large amount of data<br \/>\nis read from the pipe, this can cause a large amount of memory<br \/>\nto be allocated.\u00a0 The -B option disables this automatic<br \/>\nallocation of buffers for pipes, so that only 64K (or the<br \/>\namount of space specified by the -b option) is used for the<br \/>\npipe.\u00a0 Warning: use of -B can result in erroneous display,<br \/>\nsince only the most recently viewed part of the piped data is<br \/>\nkept in memory; any earlier data is lost.<\/p>\n<p>-c or &#8211;clear-screen<br \/>\nCauses full screen repaints to be painted from the top line<br \/>\ndown.\u00a0 By default, full screen repaints are done by scrolling<br \/>\nfrom the bottom of the screen.<\/p>\n<p>-C or &#8211;CLEAR-SCREEN<br \/>\nSame as -c, for compatibility with older versions of less.<\/p>\n<p>-d or &#8211;dumb<br \/>\nThe -d option suppresses the error message normally displayed<br \/>\nif the terminal is dumb; that is, lacks some important<br \/>\ncapability, such as the ability to clear the screen or scroll<br \/>\nbackward.\u00a0 The -d option does not otherwise change the<br \/>\nbehavior of less on a dumb terminal.<\/p>\n<p>-Dxcolor or &#8211;color=xcolor<br \/>\n[MS-DOS only] Sets the color of the text displayed.\u00a0 x is a<br \/>\nsingle character which selects the type of text whose color is<br \/>\nbeing set: n=normal, s=standout, d=bold, u=underlined,<br \/>\nk=blink.\u00a0 color is a pair of numbers separated by a period.<br \/>\nThe first number selects the foreground color and the second<br \/>\nselects the background color of the text.\u00a0 A single number N<br \/>\nis the same as N.M, where M is the normal background color.<\/p>\n<p>-e or &#8211;quit-at-eof<br \/>\nCauses less to automatically exit the second time it reaches<br \/>\nend-of-file.\u00a0 By default, the only way to exit less is via the<br \/>\n&#8220;q&#8221; command.<\/p>\n<p>-E or &#8211;QUIT-AT-EOF<br \/>\nCauses less to automatically exit the first time it reaches<br \/>\nend-of-file.<\/p>\n<p>-f or &#8211;force<br \/>\nForces non-regular files to be opened.\u00a0 (A non-regular file is<br \/>\na directory or a device special file.)\u00a0 Also suppresses the<br \/>\nwarning message when a binary file is opened.\u00a0 By default,<br \/>\nless will refuse to open non-regular files.\u00a0 Note that some<br \/>\noperating systems will not allow directories to be read, even<br \/>\nif -f is set.<\/p>\n<p>-F or &#8211;quit-if-one-screen<br \/>\nCauses less to automatically exit if the entire file can be<br \/>\ndisplayed on the first screen.<\/p>\n<p>-g or &#8211;hilite-search<br \/>\nNormally, less will highlight ALL strings which match the last<br \/>\nsearch command.\u00a0 The -g option changes this behavior to<br \/>\nhighlight only the particular string which was found by the<br \/>\nlast search command.\u00a0 This can cause less to run somewhat<br \/>\nfaster than the default.<\/p>\n<p>-G or &#8211;HILITE-SEARCH<br \/>\nThe -G option suppresses all highlighting of strings found by<br \/>\nsearch commands.<\/p>\n<p>-hn or &#8211;max-back-scroll=n<br \/>\nSpecifies a maximum number of lines to scroll backward.\u00a0 If it<br \/>\nis necessary to scroll backward more than n lines, the screen<br \/>\nis repainted in a forward direction instead.\u00a0 (If the terminal<br \/>\ndoes not have the ability to scroll backward, -h0 is implied.)<\/p>\n<p>-i or &#8211;ignore-case<br \/>\nCauses searches to ignore case; that is, uppercase and<br \/>\nlowercase are considered identical.\u00a0 This option is ignored if<br \/>\nany uppercase letters appear in the search pattern; in other<br \/>\nwords, if a pattern contains uppercase letters, then that<br \/>\nsearch does not ignore case.<\/p>\n<p>-I or &#8211;IGNORE-CASE<br \/>\nLike -i, but searches ignore case even if the pattern contains<br \/>\nuppercase letters.<\/p>\n<p>-jn or &#8211;jump-target=n<br \/>\nSpecifies a line on the screen where the &#8220;target&#8221; line is to<br \/>\nbe positioned.\u00a0 The target line is the line specified by any<br \/>\ncommand to search for a pattern, jump to a line number, jump<br \/>\nto a file percentage or jump to a tag.\u00a0 The screen line may be<br \/>\nspecified by a number: the top line on the screen is 1, the<br \/>\nnext is 2, and so on.\u00a0 The number may be negative to specify a<br \/>\nline relative to the bottom of the screen: the bottom line on<br \/>\nthe screen is -1, the second to the bottom is -2, and so on.<br \/>\nAlternately, the screen line may be specified as a fraction of<br \/>\nthe height of the screen, starting with a decimal point: .5 is<br \/>\nin the middle of the screen, .3 is three tenths down from the<br \/>\nfirst line, and so on.\u00a0 If the line is specified as a<br \/>\nfraction, the actual line number is recalculated if the<br \/>\nterminal window is resized, so that the target line remains at<br \/>\nthe specified fraction of the screen height.\u00a0 If any form of<br \/>\nthe -j option is used, forward searches begin at the line<br \/>\nimmediately after the target line, and backward searches begin<br \/>\nat the target line, unless changed by -a or -A.\u00a0 For example,<br \/>\nif &#8220;-j4&#8221; is used, the target line is the fourth line on the<br \/>\nscreen, so forward searches begin at the fifth line on the<br \/>\nscreen.<\/p>\n<p>-J or &#8211;status-column<br \/>\nDisplays a status column at the left edge of the screen.\u00a0 The<br \/>\nstatus column shows the lines that matched the current search.<br \/>\nThe status column is also used if the -w or -W option is in<br \/>\neffect.<\/p>\n<p>-kfilename or &#8211;lesskey-file=filename<br \/>\nCauses less to open and interpret the named file as a lesskey<br \/>\n(1) file.\u00a0 Multiple -k options may be specified.\u00a0 If the<br \/>\nLESSKEY or LESSKEY_SYSTEM environment variable is set, or if a<br \/>\nlesskey file is found in a standard place (see KEY BINDINGS),<br \/>\nit is also used as a lesskey file.<\/p>\n<p>-K or &#8211;quit-on-intr<br \/>\nCauses less to exit immediately (with status 2) when an<br \/>\ninterrupt character (usually ^C) is typed.\u00a0 Normally, an<br \/>\ninterrupt character causes less to stop whatever it is doing<br \/>\nand return to its command prompt.\u00a0 Note that use of this<br \/>\noption makes it impossible to return to the command prompt<br \/>\nfrom the &#8220;F&#8221; command.<\/p>\n<p>-L or &#8211;no-lessopen<br \/>\nIgnore the LESSOPEN environment variable (see the INPUT<br \/>\nPREPROCESSOR section below).\u00a0 This option can be set from<br \/>\nwithin less, but it will apply only to files opened<br \/>\nsubsequently, not to the file which is currently open.<\/p>\n<p>-m or &#8211;long-prompt<br \/>\nCauses less to prompt verbosely (like more), with the percent<br \/>\ninto the file.\u00a0 By default, less prompts with a colon.<\/p>\n<p>-M or &#8211;LONG-PROMPT<br \/>\nCauses less to prompt even more verbosely than more.<\/p>\n<p>-n or &#8211;line-numbers<br \/>\nSuppresses line numbers.\u00a0 The default (to use line numbers)<br \/>\nmay cause less to run more slowly in some cases, especially<br \/>\nwith a very large input file.\u00a0 Suppressing line numbers with<br \/>\nthe -n option will avoid this problem.\u00a0 Using line numbers<br \/>\nmeans: the line number will be displayed in the verbose prompt<br \/>\nand in the = command, and the v command will pass the current<br \/>\nline number to the editor (see also the discussion of LESSEDIT<br \/>\nin PROMPTS below).<\/p>\n<p>-N or &#8211;LINE-NUMBERS<br \/>\nCauses a line number to be displayed at the beginning of each<br \/>\nline in the display.<\/p>\n<p>-ofilename or &#8211;log-file=filename<br \/>\nCauses less to copy its input to the named file as it is being<br \/>\nviewed.\u00a0 This applies only when the input file is a pipe, not<br \/>\nan ordinary file.\u00a0 If the file already exists, less will ask<br \/>\nfor confirmation before overwriting it.<\/p>\n<p>-Ofilename or &#8211;LOG-FILE=filename<br \/>\nThe -O option is like -o, but it will overwrite an existing<br \/>\nfile without asking for confirmation.<\/p>\n<p>If no log file has been specified, the -o and -O options can<br \/>\nbe used from within less to specify a log file.\u00a0 Without a<br \/>\nfile name, they will simply report the name of the log file.<br \/>\nThe &#8220;s&#8221; command is equivalent to specifying -o from within<br \/>\nless.<\/p>\n<p>-ppattern or &#8211;pattern=pattern<br \/>\nThe -p option on the command line is equivalent to specifying<br \/>\n+\/pattern; that is, it tells less to start at the first<br \/>\noccurrence of pattern in the file.<\/p>\n<p>-Pprompt or &#8211;prompt=prompt<br \/>\nProvides a way to tailor the three prompt styles to your own<br \/>\npreference.\u00a0 This option would normally be put in the LESS<br \/>\nenvironment variable, rather than being typed in with each<br \/>\nless command.\u00a0 Such an option must either be the last option<br \/>\nin the LESS variable, or be terminated by a dollar sign.\u00a0 -Ps<br \/>\nfollowed by a string changes the default (short) prompt to<br \/>\nthat string.\u00a0 -Pm changes the medium (-m) prompt.\u00a0 -PM changes<br \/>\nthe long (-M) prompt.\u00a0 -Ph changes the prompt for the help<br \/>\nscreen.\u00a0 -P= changes the message printed by the = command.<br \/>\n-Pw changes the message printed while waiting for data (in the<br \/>\nF command).\u00a0 All prompt strings consist of a sequence of<br \/>\nletters and special escape sequences.\u00a0 See the section on<br \/>\nPROMPTS for more details.<\/p>\n<p>-q or &#8211;quiet or &#8211;silent<br \/>\nCauses moderately &#8220;quiet&#8221; operation: the terminal bell is not<br \/>\nrung if an attempt is made to scroll past the end of the file<br \/>\nor before the beginning of the file.\u00a0 If the terminal has a<br \/>\n&#8220;visual bell&#8221;, it is used instead.\u00a0 The bell will be rung on<br \/>\ncertain other errors, such as typing an invalid character.<br \/>\nThe default is to ring the terminal bell in all such cases.<\/p>\n<p>-Q or &#8211;QUIET or &#8211;SILENT<br \/>\nCauses totally &#8220;quiet&#8221; operation: the terminal bell is never<br \/>\nrung.<\/p>\n<p>-r or &#8211;raw-control-chars<br \/>\nCauses &#8220;raw&#8221; control characters to be displayed.\u00a0 The default<br \/>\nis to display control characters using the caret notation; for<br \/>\nexample, a control-A (octal 001) is displayed as &#8220;^A&#8221;.<br \/>\nWarning: when the -r option is used, less cannot keep track of<br \/>\nthe actual appearance of the screen (since this depends on how<br \/>\nthe screen responds to each type of control character).\u00a0 Thus,<br \/>\nvarious display problems may result, such as long lines being<br \/>\nsplit in the wrong place.<\/p>\n<p>-R or &#8211;RAW-CONTROL-CHARS<br \/>\nLike -r, but only ANSI &#8220;color&#8221; escape sequences are output in<br \/>\n&#8220;raw&#8221; form.\u00a0 Unlike -r, the screen appearance is maintained<br \/>\ncorrectly in most cases.\u00a0 ANSI &#8220;color&#8221; escape sequences are<br \/>\nsequences of the form:<\/p>\n<p>ESC [ &#8230; m<\/p>\n<p>where the &#8220;&#8230;&#8221; is zero or more color specification characters<br \/>\nFor the purpose of keeping track of screen appearance, ANSI<br \/>\ncolor escape sequences are assumed to not move the cursor.<br \/>\nYou can make less think that characters other than &#8220;m&#8221; can end<br \/>\nANSI color escape sequences by setting the environment<br \/>\nvariable LESSANSIENDCHARS to the list of characters which can<br \/>\nend a color escape sequence.\u00a0 And you can make less think that<br \/>\ncharacters other than the standard ones may appear between the<br \/>\nESC and the m by setting the environment variable<br \/>\nLESSANSIMIDCHARS to the list of characters which can appear.<\/p>\n<p>-s or &#8211;squeeze-blank-lines<br \/>\nCauses consecutive blank lines to be squeezed into a single<br \/>\nblank line.\u00a0 This is useful when viewing nroff output.<\/p>\n<p>-S or &#8211;chop-long-lines<br \/>\nCauses lines longer than the screen width to be chopped<br \/>\n(truncated) rather than wrapped.\u00a0 That is, the portion of a<br \/>\nlong line that does not fit in the screen width is not shown.<br \/>\nThe default is to wrap long lines; that is, display the<br \/>\nremainder on the next line.<\/p>\n<p>-ttag or &#8211;tag=tag<br \/>\nThe -t option, followed immediately by a TAG, will edit the<br \/>\nfile containing that tag.\u00a0 For this to work, tag information<br \/>\nmust be available; for example, there may be a file in the<br \/>\ncurrent directory called &#8220;tags&#8221;, which was previously built by<br \/>\nctags (1) or an equivalent command.\u00a0 If the environment<br \/>\nvariable LESSGLOBALTAGS is set, it is taken to be the name of<br \/>\na command compatible with global (1), and that command is<br \/>\nexecuted to find the tag.\u00a0 (See<br \/>\nhttp:\/\/www.gnu.org\/software\/global\/global.html).\u00a0 The -t<br \/>\noption may also be specified from within less (using the &#8211;<br \/>\ncommand) as a way of examining a new file.\u00a0 The command &#8220;:t&#8221;<br \/>\nis equivalent to specifying -t from within less.<\/p>\n<p>-Ttagsfile or &#8211;tag-file=tagsfile<br \/>\nSpecifies a tags file to be used instead of &#8220;tags&#8221;.<\/p>\n<p>-u or &#8211;underline-special<br \/>\nCauses backspaces and carriage returns to be treated as<br \/>\nprintable characters; that is, they are sent to the terminal<br \/>\nwhen they appear in the input.<\/p>\n<p>-U or &#8211;UNDERLINE-SPECIAL<br \/>\nCauses backspaces, tabs and carriage returns to be treated as<br \/>\ncontrol characters; that is, they are handled as specified by<br \/>\nthe -r option.<\/p>\n<p>By default, if neither -u nor -U is given, backspaces which<br \/>\nappear adjacent to an underscore character are treated<br \/>\nspecially: the underlined text is displayed using the<br \/>\nterminal&#8217;s hardware underlining capability.\u00a0 Also, backspaces<br \/>\nwhich appear between two identical characters are treated<br \/>\nspecially: the overstruck text is printed using the terminal&#8217;s<br \/>\nhardware boldface capability.\u00a0 Other backspaces are deleted,<br \/>\nalong with the preceding character.\u00a0 Carriage returns<br \/>\nimmediately followed by a newline are deleted.\u00a0 Other carriage<br \/>\nreturns are handled as specified by the -r option.\u00a0 Text which<br \/>\nis overstruck or underlined can be searched for if neither -u<br \/>\nnor -U is in effect.<\/p>\n<p>-V or &#8211;version<br \/>\nDisplays the version number of less.<\/p>\n<p>-w or &#8211;hilite-unread<br \/>\nTemporarily highlights the first &#8220;new&#8221; line after a forward<br \/>\nmovement of a full page.\u00a0 The first &#8220;new&#8221; line is the line<br \/>\nimmediately following the line previously at the bottom of the<br \/>\nscreen.\u00a0 Also highlights the target line after a g or p<br \/>\ncommand.\u00a0 The highlight is removed at the next command which<br \/>\ncauses movement.\u00a0 The entire line is highlighted, unless the<br \/>\n-J option is in effect, in which case only the status column<br \/>\nis highlighted.<\/p>\n<p>-W or &#8211;HILITE-UNREAD<br \/>\nLike -w, but temporarily highlights the first new line after<br \/>\nany forward movement command larger than one line.<\/p>\n<p>-xn,&#8230; or &#8211;tabs=n,&#8230;<br \/>\nSets tab stops.\u00a0 If only one n is specified, tab stops are set<br \/>\nat multiples of n.\u00a0 If multiple values separated by commas are<br \/>\nspecified, tab stops are set at those positions, and then<br \/>\ncontinue with the same spacing as the last two.\u00a0 For example,<br \/>\n-x9,17 will set tabs at positions 9, 17, 25, 33, etc.\u00a0 The<br \/>\ndefault for n is 8.<\/p>\n<p>-X or &#8211;no-init<br \/>\nDisables sending the termcap initialization and<br \/>\ndeinitialization strings to the terminal.\u00a0 This is sometimes<br \/>\ndesirable if the deinitialization string does something<br \/>\nunnecessary, like clearing the screen.<\/p>\n<p>-yn or &#8211;max-forw-scroll=n<br \/>\nSpecifies a maximum number of lines to scroll forward.\u00a0 If it<br \/>\nis necessary to scroll forward more than n lines, the screen<br \/>\nis repainted instead.\u00a0 The -c or -C option may be used to<br \/>\nrepaint from the top of the screen if desired.\u00a0 By default,<br \/>\nany forward movement causes scrolling.<\/p>\n<p>-[z]n or &#8211;window=n<br \/>\nChanges the default scrolling window size to n lines.\u00a0 The<br \/>\ndefault is one screenful.\u00a0 The z and w commands can also be<br \/>\nused to change the window size.\u00a0 The &#8220;z&#8221; may be omitted for<br \/>\ncompatibility with some versions of more.\u00a0 If the number n is<br \/>\nnegative, it indicates n lines less than the current screen<br \/>\nsize.\u00a0 For example, if the screen is 24 lines, -z-4 sets the<br \/>\nscrolling window to 20 lines.\u00a0 If the screen is resized to 40<br \/>\nlines, the scrolling window automatically changes to 36 lines.<\/p>\n<p>-&#8220;cc or &#8211;quotes=cc<br \/>\nChanges the filename quoting character.\u00a0 This may be necessary<br \/>\nif you are trying to name a file which contains both spaces<br \/>\nand quote characters.\u00a0 Followed by a single character, this<br \/>\nchanges the quote character to that character.\u00a0 Filenames<br \/>\ncontaining a space should then be surrounded by that character<br \/>\nrather than by double quotes.\u00a0 Followed by two characters,<br \/>\nchanges the open quote to the first character, and the close<br \/>\nquote to the second character.\u00a0 Filenames containing a space<br \/>\nshould then be preceded by the open quote character and<br \/>\nfollowed by the close quote character.\u00a0 Note that even after<br \/>\nthe quote characters are changed, this option remains -&#8221; (a<br \/>\ndash followed by a double quote).<\/p>\n<p>-~ or &#8211;tilde<br \/>\nNormally lines after end of file are displayed as a single<br \/>\ntilde (~).\u00a0 This option causes lines after end of file to be<br \/>\ndisplayed as blank lines.<\/p>\n<p>-# or &#8211;shift<br \/>\nSpecifies the default number of positions to scroll<br \/>\nhorizontally in the RIGHTARROW and LEFTARROW commands.\u00a0 If the<br \/>\nnumber specified is zero, it sets the default number of<br \/>\npositions to one half of the screen width.\u00a0 Alternately, the<br \/>\nnumber may be specified as a fraction of the width of the<br \/>\nscreen, starting with a decimal point: .5 is half of the<br \/>\nscreen width, .3 is three tenths of the screen width, and so<br \/>\non.\u00a0 If the number is specified as a fraction, the actual<br \/>\nnumber of scroll positions is recalculated if the terminal<br \/>\nwindow is resized, so that the actual scroll remains at the<br \/>\nspecified fraction of the screen width.<\/p>\n<p>&#8211;follow-name<br \/>\nNormally, if the input file is renamed while an F command is<br \/>\nexecuting, less will continue to display the contents of the<br \/>\noriginal file despite its name change.\u00a0 If &#8211;follow-name is<br \/>\nspecified, during an F command less will periodically attempt<br \/>\nto reopen the file by name.\u00a0 If the reopen succeeds and the<br \/>\nfile is a different file from the original (which means that a<br \/>\nnew file has been created with the same name as the original<br \/>\n(now renamed) file), less will display the contents of that<br \/>\nnew file.<\/p>\n<p>&#8211;no-keypad<br \/>\nDisables sending the keypad initialization and<br \/>\ndeinitialization strings to the terminal.\u00a0 This is sometimes<br \/>\nuseful if the keypad strings make the numeric keypad behave in<br \/>\nan undesirable manner.<\/p>\n<p>&#8211;use-backslash<br \/>\nThis option changes the interpretations of options which<br \/>\nfollow this one.\u00a0 After the &#8211;use-backslash option, any<br \/>\nbackslash in an option string is removed and the following<br \/>\ncharacter is taken literally.\u00a0 This allows a dollar sign to be<br \/>\nincluded in option strings.<\/p>\n<p>&#8212;\u00a0\u00a0\u00a0\u00a0 A command line argument of &#8220;&#8211;&#8221; marks the end of option<br \/>\narguments.\u00a0 Any arguments following this are interpreted as<br \/>\nfilenames.\u00a0 This can be useful when viewing a file whose name<br \/>\nbegins with a &#8220;-&#8221; or &#8220;+&#8221;.<\/p>\n<p>+\u00a0\u00a0\u00a0\u00a0\u00a0 If a command line option begins with +, the remainder of that<br \/>\noption is taken to be an initial command to less.\u00a0 For<br \/>\nexample, +G tells less to start at the end of the file rather<br \/>\nthan the beginning, and +\/xyz tells it to start at the first<br \/>\noccurrence of &#8220;xyz&#8221; in the file.\u00a0 As a special case, +&lt;number&gt;<br \/>\nacts like +&lt;number&gt;g; that is, it starts the display at the<br \/>\nspecified line number (however, see the caveat under the &#8220;g&#8221;<br \/>\ncommand above).\u00a0 If the option starts with ++, the initial<br \/>\ncommand applies to every file being viewed, not just the first<br \/>\none.\u00a0 The + command described previously may also be used to<br \/>\nset (or change) an initial command for every file.<\/p>\n<p>LINE EDITING<\/p>\n<p>When entering command line at the bottom of the screen (for example,<br \/>\na filename for the :e command, or the pattern for a search command),<br \/>\ncertain keys can be used to manipulate the command line.\u00a0 Most<br \/>\ncommands have an alternate form in [ brackets ] which can be used if<br \/>\na key does not exist on a particular keyboard.\u00a0 (Note that the forms<br \/>\nbeginning with ESC do not work in some MS-DOS and Windows systems<br \/>\nbecause ESC is the line erase character.)\u00a0 Any of these special keys<br \/>\nmay be entered literally by preceding it with the &#8220;literal&#8221;<br \/>\ncharacter, either ^V or ^A.\u00a0 A backslash itself may also be entered<br \/>\nliterally by entering two backslashes.<\/p>\n<p>LEFTARROW [ ESC-h ]<br \/>\nMove the cursor one space to the left.<\/p>\n<p>RIGHTARROW [ ESC-l ]<br \/>\nMove the cursor one space to the right.<\/p>\n<p>^LEFTARROW [ ESC-b or ESC-LEFTARROW ]<br \/>\n(That is, CONTROL and LEFTARROW simultaneously.)\u00a0 Move the<br \/>\ncursor one word to the left.<\/p>\n<p>^RIGHTARROW [ ESC-w or ESC-RIGHTARROW ]<br \/>\n(That is, CONTROL and RIGHTARROW simultaneously.)\u00a0 Move the<br \/>\ncursor one word to the right.<\/p>\n<p>HOME [ ESC-0 ]<br \/>\nMove the cursor to the beginning of the line.<\/p>\n<p>END [ ESC-$ ]<br \/>\nMove the cursor to the end of the line.<\/p>\n<p>BACKSPACE<br \/>\nDelete the character to the left of the cursor, or cancel the<br \/>\ncommand if the command line is empty.<\/p>\n<p>DELETE or [ ESC-x ]<br \/>\nDelete the character under the cursor.<\/p>\n<p>^BACKSPACE [ ESC-BACKSPACE ]<br \/>\n(That is, CONTROL and BACKSPACE simultaneously.)\u00a0 Delete the<br \/>\nword to the left of the cursor.<\/p>\n<p>^DELETE [ ESC-X or ESC-DELETE ]<br \/>\n(That is, CONTROL and DELETE simultaneously.)\u00a0 Delete the word<br \/>\nunder the cursor.<\/p>\n<p>UPARROW [ ESC-k ]<br \/>\nRetrieve the previous command line.\u00a0 If you first enter some<br \/>\ntext and then press UPARROW, it will retrieve the previous<br \/>\ncommand which begins with that text.<\/p>\n<p>DOWNARROW [ ESC-j ]<br \/>\nRetrieve the next command line.\u00a0 If you first enter some text<br \/>\nand then press DOWNARROW, it will retrieve the next command<br \/>\nwhich begins with that text.<\/p>\n<p>TAB\u00a0\u00a0\u00a0 Complete the partial filename to the left of the cursor.\u00a0 If<br \/>\nit matches more than one filename, the first match is entered<br \/>\ninto the command line.\u00a0 Repeated TABs will cycle thru the<br \/>\nother matching filenames.\u00a0 If the completed filename is a<br \/>\ndirectory, a &#8220;\/&#8221; is appended to the filename.\u00a0 (On MS-DOS<br \/>\nsystems, a &#8220;\\&#8221; is appended.)\u00a0 The environment variable<br \/>\nLESSSEPARATOR can be used to specify a different character to<br \/>\nappend to a directory name.<\/p>\n<p>BACKTAB [ ESC-TAB ]<br \/>\nLike, TAB, but cycles in the reverse direction thru the<br \/>\nmatching filenames.<\/p>\n<p>^L\u00a0\u00a0\u00a0\u00a0 Complete the partial filename to the left of the cursor.\u00a0 If<br \/>\nit matches more than one filename, all matches are entered<br \/>\ninto the command line (if they fit).<\/p>\n<p>^U (Unix and OS\/2) or ESC (MS-DOS)<br \/>\nDelete the entire command line, or cancel the command if the<br \/>\ncommand line is empty.\u00a0 If you have changed your line-kill<br \/>\ncharacter in Unix to something other than ^U, that character<br \/>\nis used instead of ^U.<\/p>\n<p>^G\u00a0\u00a0\u00a0\u00a0 Delete the entire command line and return to the main prompt.<\/p>\n<p>KEY BINDINGS<\/p>\n<p>You may define your own less commands by using the program lesskey<br \/>\n(1) to create a lesskey file.\u00a0 This file specifies a set of command<br \/>\nkeys and an action associated with each key.\u00a0 You may also use<br \/>\nlesskey to change the line-editing keys (see LINE EDITING), and to<br \/>\nset environment variables.\u00a0 If the environment variable LESSKEY is<br \/>\nset, less uses that as the name of the lesskey file.\u00a0 Otherwise, less<br \/>\nlooks in a standard place for the lesskey file: On Unix systems, less<br \/>\nlooks for a lesskey file called &#8220;$HOME\/.less&#8221;.\u00a0 On MS-DOS and Windows<br \/>\nsystems, less looks for a lesskey file called &#8220;$HOME\/_less&#8221;, and if<br \/>\nit is not found there, then looks for a lesskey file called &#8220;_less&#8221;<br \/>\nin any directory specified in the PATH environment variable.\u00a0 On OS\/2<br \/>\nsystems, less looks for a lesskey file called &#8220;$HOME\/less.ini&#8221;, and<br \/>\nif it is not found, then looks for a lesskey file called &#8220;less.ini&#8221;<br \/>\nin any directory specified in the INIT environment variable, and if<br \/>\nit not found there, then looks for a lesskey file called &#8220;less.ini&#8221;<br \/>\nin any directory specified in the PATH environment variable.\u00a0 See the<br \/>\nlesskey manual page for more details.<\/p>\n<p>A system-wide lesskey file may also be set up to provide key<br \/>\nbindings.\u00a0 If a key is defined in both a local lesskey file and in<br \/>\nthe system-wide file, key bindings in the local file take precedence<br \/>\nover those in the system-wide file.\u00a0 If the environment variable<br \/>\nLESSKEY_SYSTEM is set, less uses that as the name of the system-wide<br \/>\nlesskey file.\u00a0 Otherwise, less looks in a standard place for the<br \/>\nsystem-wide lesskey file: On Unix systems, the system-wide lesskey<br \/>\nfile is \/usr\/local\/etc\/sysless.\u00a0 (However, if less was built with a<br \/>\ndifferent sysconf directory than \/usr\/local\/etc, that directory is<br \/>\nwhere the sysless file is found.)\u00a0 On MS-DOS and Windows systems, the<br \/>\nsystem-wide lesskey file is c:\\_sysless.\u00a0 On OS\/2 systems, the<br \/>\nsystem-wide lesskey file is c:\\sysless.ini.<\/p>\n<p>INPUT PREPROCESSOR<\/p>\n<p>You may define an &#8220;input preprocessor&#8221; for less.\u00a0 Before less opens a<br \/>\nfile, it first gives your input preprocessor a chance to modify the<br \/>\nway the contents of the file are displayed.\u00a0 An input preprocessor is<br \/>\nsimply an executable program (or shell script), which writes the<br \/>\ncontents of the file to a different file, called the replacement<br \/>\nfile.\u00a0 The contents of the replacement file are then displayed in<br \/>\nplace of the contents of the original file.\u00a0 However, it will appear<br \/>\nto the user as if the original file is opened; that is, less will<br \/>\ndisplay the original filename as the name of the current file.<\/p>\n<p>An input preprocessor receives one command line argument, the<br \/>\noriginal filename, as entered by the user.\u00a0 It should create the<br \/>\nreplacement file, and when finished, print the name of the<br \/>\nreplacement file to its standard output.\u00a0 If the input preprocessor<br \/>\ndoes not output a replacement filename, less uses the original file,<br \/>\nas normal.\u00a0 The input preprocessor is not called when viewing<br \/>\nstandard input.\u00a0 To set up an input preprocessor, set the LESSOPEN<br \/>\nenvironment variable to a command line which will invoke your input<br \/>\npreprocessor.\u00a0 This command line should include one occurrence of the<br \/>\nstring &#8220;%s&#8221;, which will be replaced by the filename when the input<br \/>\npreprocessor command is invoked.<\/p>\n<p>When less closes a file opened in such a way, it will call another<br \/>\nprogram, called the input postprocessor, which may perform any<br \/>\ndesired clean-up action (such as deleting the replacement file<br \/>\ncreated by LESSOPEN).\u00a0 This program receives two command line<br \/>\narguments, the original filename as entered by the user, and the name<br \/>\nof the replacement file.\u00a0 To set up an input postprocessor, set the<br \/>\nLESSCLOSE environment variable to a command line which will invoke<br \/>\nyour input postprocessor.\u00a0 It may include two occurrences of the<br \/>\nstring &#8220;%s&#8221;; the first is replaced with the original name of the file<br \/>\nand the second with the name of the replacement file, which was<br \/>\noutput by LESSOPEN.<\/p>\n<p>For example, on many Unix systems, these two scripts will allow you<br \/>\nto keep files in compressed format, but still let less view them<br \/>\ndirectly:<\/p>\n<p>lessopen.sh:<br \/>\n#! \/bin\/sh<br \/>\ncase &#8220;$1&#8243; in<br \/>\n*.Z) uncompress &#8211;<br \/>\nif [ -s \/tmp\/less.$$ ]; then<br \/>\necho \/tmp\/less.$$<br \/>\nelse<br \/>\nrm -f \/tmp\/less.$$<br \/>\nfi<br \/>\n;;<br \/>\nesac<\/p>\n<p>lessclose.sh:<br \/>\n#! \/bin\/sh<br \/>\nrm $2<\/p>\n<p>To use these scripts, put them both where they can be executed and<br \/>\nset LESSOPEN=&#8221;lessopen.sh %s&#8221;, and LESSCLOSE=&#8221;lessclose.sh %s %s&#8221;.<br \/>\nMore complex LESSOPEN and LESSCLOSE scripts may be written to accept<br \/>\nother types of compressed files, and so on.<\/p>\n<p>It is also possible to set up an input preprocessor to pipe the file<br \/>\ndata directly to less, rather than putting the data into a<br \/>\nreplacement file.\u00a0 This avoids the need to decompress the entire file<br \/>\nbefore starting to view it.\u00a0 An input preprocessor that works this<br \/>\nway is called an input pipe.\u00a0 An input pipe, instead of writing the<br \/>\nname of a replacement file on its standard output, writes the entire<br \/>\ncontents of the replacement file on its standard output.\u00a0 If the<br \/>\ninput pipe does not write any characters on its standard output, then<br \/>\nthere is no replacement file and less uses the original file, as<br \/>\nnormal.\u00a0 To use an input pipe, make the first character in the<br \/>\nLESSOPEN environment variable a vertical bar (|) to signify that the<br \/>\ninput preprocessor is an input pipe.<\/p>\n<p>For example, on many Unix systems, this script will work like the<br \/>\nprevious example scripts:<\/p>\n<p>lesspipe.sh:<br \/>\n#! \/bin\/sh<br \/>\ncase &#8220;$1&#8243; in<br \/>\n*.Z) uncompress -c $1\u00a0 2&gt;\/dev\/null<br \/>\n*)\u00a0\u00a0 exit 1<br \/>\n;;<br \/>\nesac<br \/>\nexit $?<\/p>\n<p>To use this script, put it where it can be executed and set<br \/>\nLESSOPEN=&#8221;|lesspipe.sh %s&#8221;.<\/p>\n<p>Note that a preprocessor cannot output an empty file, since that is<br \/>\ninterpreted as meaning there is no replacement, and the original file<br \/>\nis used.\u00a0 To avoid this, if LESSOPEN starts with two vertical bars,<br \/>\nthe exit status of the script becomes meaningful.\u00a0 If the exit status<br \/>\nis zero, the output is considered to be replacement text, even if it<br \/>\nempty.\u00a0 If the exit status is nonzero, any output is ignored and the<br \/>\noriginal file is used.\u00a0 For compatibility with previous versions of<br \/>\nless, if LESSOPEN starts with only one vertical bar, the exit status<br \/>\nof the preprocessor is ignored.<\/p>\n<p>When an input pipe is used, a LESSCLOSE postprocessor can be used,<br \/>\nbut it is usually not necessary since there is no replacement file to<br \/>\nclean up.\u00a0 In this case, the replacement file name passed to the<br \/>\nLESSCLOSE postprocessor is &#8220;-&#8220;.<\/p>\n<p>For compatibility with previous versions of less, the input<br \/>\npreprocessor or pipe is not used if less is viewing standard input.<br \/>\nHowever, if the first character of LESSOPEN is a dash (-), the input<br \/>\npreprocessor is used on standard input as well as other files.\u00a0 In<br \/>\nthis case, the dash is not considered to be part of the preprocessor<br \/>\ncommand.\u00a0 If standard input is being viewed, the input preprocessor<br \/>\nis passed a file name consisting of a single dash.\u00a0 Similarly, if the<br \/>\nfirst two characters of LESSOPEN are vertical bar and dash (|-) or<br \/>\ntwo vertical bars and a dash (||-), the input pipe is used on<br \/>\nstandard input as well as other files.\u00a0 Again, in this case the dash<br \/>\nis not considered to be part of the input pipe command.<\/p>\n<p>NATIONAL CHARACTER SETS<\/p>\n<p>There are three types of characters in the input file:<\/p>\n<p>normal characters<br \/>\ncan be displayed directly to the screen.<\/p>\n<p>control characters<br \/>\nshould not be displayed directly, but are expected to be found<br \/>\nin ordinary text files (such as backspace and tab).<\/p>\n<p>binary characters<br \/>\nshould not be displayed directly and are not expected to be<br \/>\nfound in text files.<\/p>\n<p>A &#8220;character set&#8221; is simply a description of which characters are to<br \/>\nbe considered normal, control, and binary.\u00a0 The LESSCHARSET<br \/>\nenvironment variable may be used to select a character set.\u00a0 Possible<br \/>\nvalues for LESSCHARSET are:<\/p>\n<p>ascii\u00a0 BS, TAB, NL, CR, and formfeed are control characters, all<br \/>\nchars with values between 32 and 126 are normal, and all<br \/>\nothers are binary.<\/p>\n<p>iso8859<br \/>\nSelects an ISO 8859 character set.\u00a0 This is the same as ASCII,<br \/>\nexcept characters between 160 and 255 are treated as normal<br \/>\ncharacters.<\/p>\n<p>latin1 Same as iso8859.<\/p>\n<p>latin9 Same as iso8859.<\/p>\n<p>dos\u00a0\u00a0\u00a0 Selects a character set appropriate for MS-DOS.<\/p>\n<p>ebcdic Selects an EBCDIC character set.<\/p>\n<p>IBM-1047<br \/>\nSelects an EBCDIC character set used by OS\/390 Unix Services.<br \/>\nThis is the EBCDIC analogue of latin1.\u00a0 You get similar<br \/>\nresults by setting either LESSCHARSET=IBM-1047 or<br \/>\nLC_CTYPE=en_US in your environment.<\/p>\n<p>koi8-r Selects a Russian character set.<\/p>\n<p>next\u00a0\u00a0 Selects a character set appropriate for NeXT computers.<\/p>\n<p>utf-8\u00a0 Selects the UTF-8 encoding of the ISO 10646 character set.<br \/>\nUTF-8 is special in that it supports multi-byte characters in<br \/>\nthe input file.\u00a0 It is the only character set that supports<br \/>\nmulti-byte characters.<\/p>\n<p>windows<br \/>\nSelects a character set appropriate for Microsoft Windows (cp<br \/>\n1251).<\/p>\n<p>In rare cases, it may be desired to tailor less to use a character<br \/>\nset other than the ones definable by LESSCHARSET.\u00a0 In this case, the<br \/>\nenvironment variable LESSCHARDEF can be used to define a character<br \/>\nset.\u00a0 It should be set to a string where each character in the string<br \/>\nrepresents one character in the character set.\u00a0 The character &#8220;.&#8221; is<br \/>\nused for a normal character, &#8220;c&#8221; for control, and &#8220;b&#8221; for binary.\u00a0 A<br \/>\ndecimal number may be used for repetition.\u00a0 For example, &#8220;bccc4b.&#8221;<br \/>\nwould mean character 0 is binary, 1, 2 and 3 are control, 4, 5, 6 and<br \/>\n7 are binary, and 8 is normal.\u00a0 All characters after the last are<br \/>\ntaken to be the same as the last, so characters 9 through 255 would<br \/>\nbe normal.\u00a0 (This is an example, and does not necessarily represent<br \/>\nany real character set.)<\/p>\n<p>This table shows the value of LESSCHARDEF which is equivalent to each<br \/>\nof the possible values for LESSCHARSET:<\/p>\n<p>ascii\u00a0\u00a0\u00a0\u00a0 8bcccbcc18b95.b<br \/>\ndos\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 8bcccbcc12bc5b95.b.<br \/>\nebcdic\u00a0\u00a0\u00a0 5bc6bcc7bcc41b.9b7.9b5.b..8b6.10b6.b9.7b<br \/>\n9.8b8.17b3.3b9.7b9.8b8.6b10.b.b.b.<br \/>\nIBM-1047\u00a0 4cbcbc3b9cbccbccbb4c6bcc5b3cbbc4bc4bccbc<br \/>\n191.b<br \/>\niso8859\u00a0\u00a0 8bcccbcc18b95.33b.<br \/>\nkoi8-r\u00a0\u00a0\u00a0 8bcccbcc18b95.b128.<br \/>\nlatin1\u00a0\u00a0\u00a0 8bcccbcc18b95.33b.<br \/>\nnext\u00a0\u00a0\u00a0\u00a0\u00a0 8bcccbcc18b95.bb125.bb<\/p>\n<p>If neither LESSCHARSET nor LESSCHARDEF is set, but any of the strings<br \/>\n&#8220;UTF-8&#8221;, &#8220;UTF8&#8221;, &#8220;utf-8&#8221; or &#8220;utf8&#8221; is found in the LC_ALL, LC_CTYPE<br \/>\nor LANG environment variables, then the default character set is<br \/>\nutf-8.<\/p>\n<p>If that string is not found, but your system supports the setlocale<br \/>\ninterface, less will use setlocale to determine the character set.<br \/>\nsetlocale is controlled by setting the LANG or LC_CTYPE environment<br \/>\nvariables.<\/p>\n<p>Finally, if the setlocale interface is also not available, the<br \/>\ndefault character set is latin1.<\/p>\n<p>Control and binary characters are displayed in standout (reverse<br \/>\nvideo).\u00a0 Each such character is displayed in caret notation if<br \/>\npossible (e.g. ^A for control-A).\u00a0 Caret notation is used only if<br \/>\ninverting the 0100 bit results in a normal printable character.<br \/>\nOtherwise, the character is displayed as a hex number in angle<br \/>\nbrackets.\u00a0 This format can be changed by setting the LESSBINFMT<br \/>\nenvironment variable.\u00a0 LESSBINFMT may begin with a &#8220;*&#8221; and one<br \/>\ncharacter to select the display attribute: &#8220;*k&#8221; is blinking, &#8220;*d&#8221; is<br \/>\nbold, &#8220;*u&#8221; is underlined, &#8220;*s&#8221; is standout, and &#8220;*n&#8221; is normal.\u00a0 If<br \/>\nLESSBINFMT does not begin with a &#8220;*&#8221;, normal attribute is assumed.<br \/>\nThe remainder of LESSBINFMT is a string which may include one printf-<br \/>\nstyle escape sequence (a % followed by x, X, o, d, etc.).\u00a0 For<br \/>\nexample, if LESSBINFMT is &#8220;*u[%x]&#8221;, binary characters are displayed<br \/>\nin underlined hexadecimal surrounded by brackets.\u00a0 The default if no<br \/>\nLESSBINFMT is specified is &#8220;*s&lt;%02X&gt;&#8221;.\u00a0 Warning: the result of<br \/>\nexpanding the character via LESSBINFMT must be less than 31<br \/>\ncharacters.<\/p>\n<p>When the character set is utf-8, the LESSUTFBINFMT environment<br \/>\nvariable acts similarly to LESSBINFMT but it applies to Unicode code<br \/>\npoints that were successfully decoded but are unsuitable for display<br \/>\n(e.g., unassigned code points).\u00a0 Its default value is &#8220;&lt;U+%04lX&gt;&#8221;.<br \/>\nNote that LESSUTFBINFMT and LESSBINFMT share their display attribute<br \/>\nsetting (&#8220;*x&#8221;) so specifying one will affect both; LESSUTFBINFMT is<br \/>\nread after LESSBINFMT so its setting, if any, will have priority.<br \/>\nProblematic octets in a UTF-8 file (octets of a truncated sequence,<br \/>\noctets of a complete but non-shortest form sequence, illegal octets,<br \/>\nand stray trailing octets) are displayed individually using<br \/>\nLESSBINFMT so as to facilitate diagnostic of how the UTF-8 file is<br \/>\nill-formed.<\/p>\n<p>PROMPTS<\/p>\n<p>The -P option allows you to tailor the prompt to your preference.<br \/>\nThe string given to the -P option replaces the specified prompt<br \/>\nstring.\u00a0 Certain characters in the string are interpreted specially.<br \/>\nThe prompt mechanism is rather complicated to provide flexibility,<br \/>\nbut the ordinary user need not understand the details of constructing<br \/>\npersonalized prompt strings.<\/p>\n<p>A percent sign followed by a single character is expanded according<br \/>\nto what the following character is:<\/p>\n<p>%bX\u00a0\u00a0\u00a0 Replaced by the byte offset into the current input file.\u00a0 The<br \/>\nb is followed by a single character (shown as X above) which<br \/>\nspecifies the line whose byte offset is to be used.\u00a0 If the<br \/>\ncharacter is a &#8220;t&#8221;, the byte offset of the top line in the<br \/>\ndisplay is used, an &#8220;m&#8221; means use the middle line, a &#8220;b&#8221; means<br \/>\nuse the bottom line, a &#8220;B&#8221; means use the line just after the<br \/>\nbottom line, and a &#8220;j&#8221; means use the &#8220;target&#8221; line, as<br \/>\nspecified by the -j option.<\/p>\n<p>%B\u00a0\u00a0\u00a0\u00a0 Replaced by the size of the current input file.<\/p>\n<p>%c\u00a0\u00a0\u00a0\u00a0 Replaced by the column number of the text appearing in the<br \/>\nfirst column of the screen.<\/p>\n<p>%dX\u00a0\u00a0\u00a0 Replaced by the page number of a line in the input file.\u00a0 The<br \/>\nline to be used is determined by the X, as with the %b option.<\/p>\n<p>%D\u00a0\u00a0\u00a0\u00a0 Replaced by the number of pages in the input file, or<br \/>\nequivalently, the page number of the last line in the input<br \/>\nfile.<\/p>\n<p>%E\u00a0\u00a0\u00a0\u00a0 Replaced by the name of the editor (from the VISUAL<br \/>\nenvironment variable, or the EDITOR environment variable if<br \/>\nVISUAL is not defined).\u00a0 See the discussion of the LESSEDIT<br \/>\nfeature below.<\/p>\n<p>%f\u00a0\u00a0\u00a0\u00a0 Replaced by the name of the current input file.<\/p>\n<p>%F\u00a0\u00a0\u00a0\u00a0 Replaced by the last component of the name of the current<br \/>\ninput file.<\/p>\n<p>%i\u00a0\u00a0\u00a0\u00a0 Replaced by the index of the current file in the list of input<br \/>\nfiles.<\/p>\n<p>%lX\u00a0\u00a0\u00a0 Replaced by the line number of a line in the input file.\u00a0 The<br \/>\nline to be used is determined by the X, as with the %b option.<\/p>\n<p>%L\u00a0\u00a0\u00a0\u00a0 Replaced by the line number of the last line in the input<br \/>\nfile.<\/p>\n<p>%m\u00a0\u00a0\u00a0\u00a0 Replaced by the total number of input files.<\/p>\n<p>%pX\u00a0\u00a0\u00a0 Replaced by the percent into the current input file, based on<br \/>\nbyte offsets.\u00a0 The line used is determined by the X as with<br \/>\nthe %b option.<\/p>\n<p>%PX\u00a0\u00a0\u00a0 Replaced by the percent into the current input file, based on<br \/>\nline numbers.\u00a0 The line used is determined by the X as with<br \/>\nthe %b option.<\/p>\n<p>%s\u00a0\u00a0\u00a0\u00a0 Same as %B.<\/p>\n<p>%t\u00a0\u00a0\u00a0\u00a0 Causes any trailing spaces to be removed.\u00a0 Usually used at the<br \/>\nend of the string, but may appear anywhere.<\/p>\n<p>%x\u00a0\u00a0\u00a0\u00a0 Replaced by the name of the next input file in the list.<\/p>\n<p>If any item is unknown (for example, the file size if input is a<br \/>\npipe), a question mark is printed instead.<\/p>\n<p>The format of the prompt string can be changed depending on certain<br \/>\nconditions.\u00a0 A question mark followed by a single character acts like<br \/>\nan &#8220;IF&#8221;: depending on the following character, a condition is<br \/>\nevaluated.\u00a0 If the condition is true, any characters following the<br \/>\nquestion mark and condition character, up to a period, are included<br \/>\nin the prompt.\u00a0 If the condition is false, such characters are not<br \/>\nincluded.\u00a0 A colon appearing between the question mark and the period<br \/>\ncan be used to establish an &#8220;ELSE&#8221;: any characters between the colon<br \/>\nand the period are included in the string if and only if the IF<br \/>\ncondition is false.\u00a0 Condition characters (which follow a question<br \/>\nmark) may be:<\/p>\n<p>?a\u00a0\u00a0\u00a0\u00a0 True if any characters have been included in the prompt so<br \/>\nfar.<\/p>\n<p>?bX\u00a0\u00a0\u00a0 True if the byte offset of the specified line is known.<\/p>\n<p>?B\u00a0\u00a0\u00a0\u00a0 True if the size of current input file is known.<\/p>\n<p>?c\u00a0\u00a0\u00a0\u00a0 True if the text is horizontally shifted (%c is not zero).<\/p>\n<p>?dX\u00a0\u00a0\u00a0 True if the page number of the specified line is known.<\/p>\n<p>?e\u00a0\u00a0\u00a0\u00a0 True if at end-of-file.<\/p>\n<p>?f\u00a0\u00a0\u00a0\u00a0 True if there is an input filename (that is, if input is not a<br \/>\npipe).<\/p>\n<p>?lX\u00a0\u00a0\u00a0 True if the line number of the specified line is known.<\/p>\n<p>?L\u00a0\u00a0\u00a0\u00a0 True if the line number of the last line in the file is known.<\/p>\n<p>?m\u00a0\u00a0\u00a0\u00a0 True if there is more than one input file.<\/p>\n<p>?n\u00a0\u00a0\u00a0\u00a0 True if this is the first prompt in a new input file.<\/p>\n<p>?pX\u00a0\u00a0\u00a0 True if the percent into the current input file, based on byte<br \/>\noffsets, of the specified line is known.<\/p>\n<p>?PX\u00a0\u00a0\u00a0 True if the percent into the current input file, based on line<br \/>\nnumbers, of the specified line is known.<\/p>\n<p>?s\u00a0\u00a0\u00a0\u00a0 Same as &#8220;?B&#8221;.<\/p>\n<p>?x\u00a0\u00a0\u00a0\u00a0 True if there is a next input file (that is, if the current<br \/>\ninput file is not the last one).<\/p>\n<p>Any characters other than the special ones (question mark, colon,<br \/>\nperiod, percent, and backslash) become literally part of the prompt.<br \/>\nAny of the special characters may be included in the prompt literally<br \/>\nby preceding it with a backslash.<\/p>\n<p>Some examples:<\/p>\n<p>?f%f:Standard input.<\/p>\n<p>This prompt prints the filename, if known; otherwise the string<br \/>\n&#8220;Standard input&#8221;.<\/p>\n<p>?f%f .?ltLine %lt:?pt%pt\\%:?btByte %bt:-&#8230;<\/p>\n<p>This prompt would print the filename, if known.\u00a0 The filename is<br \/>\nfollowed by the line number, if known, otherwise the percent if<br \/>\nknown, otherwise the byte offset if known.\u00a0 Otherwise, a dash is<br \/>\nprinted.\u00a0 Notice how each question mark has a matching period, and<br \/>\nhow the % after the %pt is included literally by escaping it with a<br \/>\nbackslash.<\/p>\n<p>?n?f%f .?m(file %i of %m) ..?e(END) ?x- Next\\: %x..%t<\/p>\n<p>This prints the filename if this is the first prompt in a file,<br \/>\nfollowed by the &#8220;file N of N&#8221; message if there is more than one input<br \/>\nfile.\u00a0 Then, if we are at end-of-file, the string &#8220;(END)&#8221; is printed<br \/>\nfollowed by the name of the next file, if there is one.\u00a0 Finally, any<br \/>\ntrailing spaces are truncated.\u00a0 This is the default prompt.\u00a0 For<br \/>\nreference, here are the defaults for the other two prompts (-m and -M<br \/>\nrespectively).\u00a0 Each is broken into two lines here for readability<br \/>\nonly.<\/p>\n<p>?n?f%f .?m(file %i of %m) ..?e(END) ?x- Next\\: %x.:<br \/>\n?pB%pB\\%:byte %bB?s\/%s&#8230;%t<\/p>\n<p>?f%f .?n?m(file %i of %m) ..?ltlines %lt-%lb?L\/%L. :<br \/>\nbyte %bB?s\/%s. .?e(END) ?x- Next\\: %x.:?pB%pB\\%..%t<\/p>\n<p>And here is the default message produced by the = command:<\/p>\n<p>?f%f .?m(file %i of %m) .?ltlines %lt-%lb?L\/%L. .<br \/>\nbyte %bB?s\/%s. ?e(END) :?pB%pB\\%..%t<\/p>\n<p>The prompt expansion features are also used for another purpose: if<br \/>\nan environment variable LESSEDIT is defined, it is used as the<br \/>\ncommand to be executed when the v command is invoked.\u00a0 The LESSEDIT<br \/>\nstring is expanded in the same way as the prompt strings.\u00a0 The<br \/>\ndefault value for LESSEDIT is:<\/p>\n<p>%E ?lm+%lm. %f<\/p>\n<p>Note that this expands to the editor name, followed by a + and the<br \/>\nline number, followed by the file name.\u00a0 If your editor does not<br \/>\naccept the &#8220;+linenumber&#8221; syntax, or has other differences in<br \/>\ninvocation syntax, the LESSEDIT variable can be changed to modify<br \/>\nthis default.<\/p>\n<p>SECURITY<\/p>\n<p>When the environment variable LESSSECURE is set to 1, less runs in a<br \/>\n&#8220;secure&#8221; mode.\u00a0 This means these features are disabled:<\/p>\n<p>!\u00a0\u00a0\u00a0\u00a0\u00a0 the shell command<\/p>\n<p>|\u00a0\u00a0\u00a0\u00a0\u00a0 the pipe command<\/p>\n<p>:e\u00a0\u00a0\u00a0\u00a0 the examine command.<\/p>\n<p>v\u00a0\u00a0\u00a0\u00a0\u00a0 the editing command<\/p>\n<p>s\u00a0 -o\u00a0 log files<\/p>\n<p>-k\u00a0\u00a0\u00a0\u00a0 use of lesskey files<\/p>\n<p>-t\u00a0\u00a0\u00a0\u00a0 use of tags files<\/p>\n<p>metacharacters in filenames, such as *<\/p>\n<p>filename completion (TAB, ^L)<\/p>\n<p>Less can also be compiled to be permanently in &#8220;secure&#8221; mode.<\/p>\n<p>COMPATIBILITY WITH MORE<\/p>\n<p>If the environment variable LESS_IS_MORE is set to 1, or if the<br \/>\nprogram is invoked via a file link named &#8220;more&#8221;, less behaves<br \/>\n(mostly) in conformance with the POSIX &#8220;more&#8221; command specification.<br \/>\nIn this mode, less behaves differently in these ways:<\/p>\n<p>The -e option works differently.\u00a0 If the -e option is not set, less<br \/>\nbehaves as if the -E option were set.\u00a0 If the -e option is set, less<br \/>\nbehaves as if the -e and -F options were set.<\/p>\n<p>The -m option works differently.\u00a0 If the -m option is not set, the<br \/>\nmedium prompt is used, and it is prefixed with the string &#8220;&#8211;More&#8211;&#8220;.<br \/>\nIf the -m option is set, the short prompt is used.<\/p>\n<p>The -n option acts like the -z option.\u00a0 The normal behavior of the -n<br \/>\noption is unavailable in this mode.<\/p>\n<p>The parameter to the -p option is taken to be a less command rather<br \/>\nthan a search pattern.<\/p>\n<p>The LESS environment variable is ignored, and the MORE environment<br \/>\nvariable is used in its place.<\/p>\n<p>ENVIRONMENT VARIABLES<\/p>\n<p>Environment variables may be specified either in the system<br \/>\nenvironment as usual, or in a lesskey (1) file.\u00a0 If environment<br \/>\nvariables are defined in more than one place, variables defined in a<br \/>\nlocal lesskey file take precedence over variables defined in the<br \/>\nsystem environment, which take precedence over variables defined in<br \/>\nthe system-wide lesskey file.<\/p>\n<p>COLUMNS<br \/>\nSets the number of columns on the screen.\u00a0 Takes precedence<br \/>\nover the number of columns specified by the TERM variable.<br \/>\n(But if you have a windowing system which supports TIOCGWINSZ<br \/>\nor WIOCGETD, the window system&#8217;s idea of the screen size takes<br \/>\nprecedence over the LINES and COLUMNS environment variables.)<\/p>\n<p>EDITOR The name of the editor (used for the v command).<\/p>\n<p>HOME\u00a0\u00a0 Name of the user&#8217;s home directory (used to find a lesskey file<br \/>\non Unix and OS\/2 systems).<\/p>\n<p>HOMEDRIVE, HOMEPATH<br \/>\nConcatenation of the HOMEDRIVE and HOMEPATH environment<br \/>\nvariables is the name of the user&#8217;s home directory if the HOME<br \/>\nvariable is not set (only in the Windows version).<\/p>\n<p>INIT\u00a0\u00a0 Name of the user&#8217;s init directory (used to find a lesskey file<br \/>\non OS\/2 systems).<\/p>\n<p>LANG\u00a0\u00a0 Language for determining the character set.<\/p>\n<p>LC_CTYPE<br \/>\nLanguage for determining the character set.<\/p>\n<p>LESS\u00a0\u00a0 Options which are passed to less automatically.<\/p>\n<p>LESSANSIENDCHARS<br \/>\nCharacters which may end an ANSI color escape sequence<br \/>\n(default &#8220;m&#8221;).<\/p>\n<p>LESSANSIMIDCHARS<br \/>\nCharacters which may appear between the ESC character and the<br \/>\nend character in an ANSI color escape sequence (default<br \/>\n&#8220;0123456789;[?!&#8221;&#8216;#%()*+ &#8220;.<\/p>\n<p>LESSBINFMT<br \/>\nFormat for displaying non-printable, non-control characters.<\/p>\n<p>LESSCHARDEF<br \/>\nDefines a character set.<\/p>\n<p>LESSCHARSET<br \/>\nSelects a predefined character set.<\/p>\n<p>LESSCLOSE<br \/>\nCommand line to invoke the (optional) input-postprocessor.<\/p>\n<p>LESSECHO<br \/>\nName of the lessecho program (default &#8220;lessecho&#8221;).\u00a0 The<br \/>\nlessecho program is needed to expand metacharacters, such as *<br \/>\nand ?, in filenames on Unix systems.<\/p>\n<p>LESSEDIT<br \/>\nEditor prototype string (used for the v command).\u00a0 See<br \/>\ndiscussion under PROMPTS.<\/p>\n<p>LESSGLOBALTAGS<br \/>\nName of the command used by the -t option to find global tags.<br \/>\nNormally should be set to &#8220;global&#8221; if your system has the<br \/>\nglobal (1) command.\u00a0 If not set, global tags are not used.<\/p>\n<p>LESSHISTFILE<br \/>\nName of the history file used to remember search commands and<br \/>\nshell commands between invocations of less.\u00a0 If set to &#8220;-&#8221; or<br \/>\n&#8220;\/dev\/null&#8221;, a history file is not used.\u00a0 The default is<br \/>\n&#8220;$HOME\/.lesshst&#8221; on Unix systems, &#8220;$HOME\/_lesshst&#8221; on DOS and<br \/>\nWindows systems, or &#8220;$HOME\/lesshst.ini&#8221; or &#8220;$INIT\/lesshst.ini&#8221;<br \/>\non OS\/2 systems.<\/p>\n<p>LESSHISTSIZE<br \/>\nThe maximum number of commands to save in the history file.<br \/>\nThe default is 100.<\/p>\n<p>LESSKEY<br \/>\nName of the default lesskey(1) file.<\/p>\n<p>LESSKEY_SYSTEM<br \/>\nName of the default system-wide lesskey(1) file.<\/p>\n<p>LESSMETACHARS<br \/>\nList of characters which are considered &#8220;metacharacters&#8221; by<br \/>\nthe shell.<\/p>\n<p>LESSMETAESCAPE<br \/>\nPrefix which less will add before each metacharacter in a<br \/>\ncommand sent to the shell.\u00a0 If LESSMETAESCAPE is an empty<br \/>\nstring, commands containing metacharacters will not be passed<br \/>\nto the shell.<\/p>\n<p>LESSOPEN<br \/>\nCommand line to invoke the (optional) input-preprocessor.<\/p>\n<p>LESSSECURE<br \/>\nRuns less in &#8220;secure&#8221; mode.\u00a0 See discussion under SECURITY.<\/p>\n<p>LESSSEPARATOR<br \/>\nString to be appended to a directory name in filename<br \/>\ncompletion.<\/p>\n<p>LESSUTFBINFMT<br \/>\nFormat for displaying non-printable Unicode code points.<\/p>\n<p>LESS_IS_MORE<br \/>\nEmulate the more (1) command.<\/p>\n<p>LINES\u00a0 Sets the number of lines on the screen.\u00a0 Takes precedence over<br \/>\nthe number of lines specified by the TERM variable.\u00a0 (But if<br \/>\nyou have a windowing system which supports TIOCGWINSZ or<br \/>\nWIOCGETD, the window system&#8217;s idea of the screen size takes<br \/>\nprecedence over the LINES and COLUMNS environment variables.)<\/p>\n<p>MORE\u00a0\u00a0 Options which are passed to less automatically when running in<br \/>\nmore compatible mode.<\/p>\n<p>PATH\u00a0\u00a0 User&#8217;s search path (used to find a lesskey file on MS-DOS and<br \/>\nOS\/2 systems).<\/p>\n<p>SHELL\u00a0 The shell used to execute the ! command, as well as to expand<br \/>\nfilenames.<\/p>\n<p>TERM\u00a0\u00a0 The type of terminal on which less is being run.<\/p>\n<p>VISUAL The name of the editor (used for the v command).<\/p>\n<p>SEE ALSO<\/p>\n<p>lesskey(1)<\/p>\n<p>COPYRIGHT<\/p>\n<p>Copyright (C) 1984-2012\u00a0 Mark Nudelman<\/p>\n<p>less is part of the GNU project and is free software.\u00a0 You can<br \/>\nredistribute it and\/or modify it under the terms of either (1) the<br \/>\nGNU General Public License as published by the Free Software<br \/>\nFoundation; or (2) the Less License.\u00a0 See the file README in the less<br \/>\ndistribution for more details regarding redistribution.\u00a0 You should<br \/>\nhave received a copy of the GNU General Public License along with the<br \/>\nsource for less; see the file COPYING.\u00a0 If not, write to the Free<br \/>\nSoftware Foundation, 59 Temple Place, Suite 330, Boston, MA<br \/>\n02111-1307, USA.\u00a0 You should also have received a copy of the Less<br \/>\nLicense; see the file LICENSE.<\/p>\n<p>less is distributed in the hope that it will be useful, but WITHOUT<br \/>\nANY WARRANTY; without even the implied warranty of MERCHANTABILITY or<br \/>\nFITNESS FOR A PARTICULAR PURPOSE.\u00a0 See the GNU General Public License<br \/>\nfor more details.<\/p>\n<p>AUTHOR<\/p>\n<p>Mark Nudelman<br \/>\nSend bug reports or comments to &lt;bug-less@gnu.org&gt;<br \/>\nSee http:\/\/www.greenwoodsoftware.com\/less\/bugs.html for the latest<br \/>\nlist of known bugs in less.<br \/>\nFor more information, see the less homepage at<br \/>\nhttp:\/\/www.greenwoodsoftware.com\/less.<\/p>\n<p>COLOPHON<\/p>\n<p>This page is part of the less (A file pager) project.\u00a0 Information<br \/>\nabout the project can be found at<br \/>\n\u27e8http:\/\/www.greenwoodsoftware.com\/less\/\u27e9.\u00a0 If you have a bug report<br \/>\nfor this manual page, see<br \/>\n\u27e8http:\/\/www.greenwoodsoftware.com\/less\/faq.html#bugs\u27e9.\u00a0 This page was<br \/>\nobtained from the tarball less-458.tar.gz fetched from<br \/>\n\u27e8http:\/\/www.greenwoodsoftware.com\/less\/download.html\u27e9 on 2014-12-30.<br \/>\nIf you discover any rendering problems in this HTML version of the<br \/>\npage, or you believe there is a better or more up-to-date source for<br \/>\nthe page, or you have corrections or improvements to the information<br \/>\nin this COLOPHON (which is not part of the original manual page),<br \/>\nsend a mail to\u00a0man-pages@man7.org<\/p>\n<p>Version 458: 04 Apr 2013\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 LESS(1)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>LESS(1)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 General Commands Manual\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 LESS(1) NAME less &#8211; opposite of more SYNOPSIS less -? less &#8211;help less -V less &#8211;version less [-[+]aABcCdeEfFgGiIJKLmMnNqQrRsSuUVwWX~] [-b space] [-h lines] [-j line] [-k keyfile] [-{oO} logfile] [-p pattern] [-P prompt] [-t tag] [-T tagsfile] [-x tab,&#8230;] [-y lines] [-[z] lines] [-# shift] [+[+]cmd] [&#8211;] [filename]&#8230; (See the OPTIONS section [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_sitemap_exclude":false,"_sitemap_priority":"","_sitemap_frequency":"","footnotes":""},"categories":[8],"tags":[],"class_list":["post-333","post","type-post","status-publish","format-standard","hentry","category-shell"],"a3_pvc":{"activated":false,"total_views":0,"today_views":0},"_links":{"self":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/posts\/333","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=333"}],"version-history":[{"count":0,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/posts\/333\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=333"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=333"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=333"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}