Title: Theory / Unimportant / CS / command line / text analysis / less
Tags: récupéré FromInstruction computer_to_instruction fromCommand hasNotNewEffectReturnsMeaning some_instruction mid1516974248815 seen_description automatedNewLineAfterCommaSpace
On every note of this deck, unless a note says otherwise:
Page: man
Page: man
Prefix: less
Page: man
Context: less

Instruction: ^X^X
Effect: Same as single quote.
Context: less

Instruction: ESC-/pattern
Effect: Same as "/*"
Context: less

Instruction: ESC-?pattern
Effect: Same as "?*"
Context: less

Instruction: n
Effect: Repeat previous search, for N-th line containing the last pattern. If the previous search was modified by ^N, the search is made for the N-th line NOT containing the pattern. If the previous search was modified by ^E, the search continues in the next (or previous) file if not satisfied in the current file. If the previous search was modified by ^R, the search is done without using regular expressions. There is no effect if the previous search was modified by ^F or ^K.
Context: less

Instruction: N
Effect: Repeat previous search, but in the reverse direction.
Context: less

Instruction: ESC-n
Effect: Repeat previous search, but crossing file boundaries. The effect is as if the previous search were modified by *.
Context: less

Instruction: ESC-N
Effect: Repeat previous search, but in the reverse direction and crossing file boundaries.
Context: less

Instruction: ESC-u
Effect: Undo search highlighting.
Context: less
Extra: Turn off highlighting of strings matching the current search pattern. If highlighting is already off because of a previous ESC-u command, turn highlighting back on. Any search command will also turn highlighting back on. (Highlighting can also be disabled by toggling the -G option; in that case search commands do not turn highlighting back on.)

Instruction: &pattern
Effect: Display only lines which match the pattern; lines which do not match the pattern are not displayed. If pattern is empty (if you type & immediately followed by ENTER), any filtering is turned off, and all lines are displayed. While filtering is in effect, an ampersand is displayed at the beginning of the prompt, as a reminder that some lines in the file may be hidden.
Context: less

Instruction: :e [filename]
^X^V or E
Effect: Examine a new file. If the filename is missing, the "current" file (see the :n and :p commands below) from the list of files in the command line is re-examined. A percent sign (%) in the filename is replaced by the name of the current file. A pound sign (#) is replaced by the name of the previously examined file. However, two consecutive percent signs are simply replaced with a single percent sign. This allows you to enter a filename that contains a percent sign in the name. Similarly, two consecutive pound signs are replaced with a single pound sign. The filename is inserted into the command line list of files so that it can be seen by subsequent :n and :p commands. If the filename consists of several files, they are all inserted into the list of files and the first one is examined. If the filename contains one or more spaces, the entire filename should be enclosed in double quotes (also see the -" option).
Context: less

Instruction: :n
Effect: Examine the next file (from the list of files given in the command line). If a number N is specified, the N-th next file is examined.
Context: less

Instruction: :p
Effect: Examine the previous file in the command line list. If a number N is specified, the N-th previous file is examined.
Context: less

Instruction: :x
Effect: Examine the first file in the command line list. If a number N is specified, the N-th file in the list is examined.
Context: less

Instruction: :d
Effect: Remove the current file from the list of files.
Context: less

Instruction: t
Effect: Go to the next tag, if there were more than one matches for the current tag. See the -t option for more details about tags.
Context: less

Instruction: T
Effect: Go to the previous tag, if there were more than one matches for the current tag.
Context: less

Instruction: = or ^G or :f
Effect: Prints some information about the file being viewed, including its name and the line number and byte offset of the bottom line being displayed. If possible, it also prints the length of the file, the number of lines in the file and the percent of the file above the last displayed line.
Context: less

Fla: -commandLineOption
Effect: change the setting of commandLineOption and print a message describing the new setting. If a ^P (CONTROL-P) is entered immediately after the dash, the setting of the option is changed but no message is printed. If the option letter has a numeric value (such as -b or -h), or a string value (such as -P or -t), a new value may be entered after the option letter. If no new value is entered, a message describing the current setting is printed and nothing is changed.

Fla: --LongCommandOption
Effect: Like the - command, but takes a long option name (see OPTIONS below) rather than a single option letter. You must press RETURN after typing the option name. A ^P immediately after the second dash suppresses printing of a message describing the new setting, as in the - command.

Fla: -+commandOptionLetter
Effect: Followed by one of the command line option letters this will reset the option to its default setting and print a message describing the new setting. (The "-+X" command does the same thing as "-+X" on the command line.) This does not work for string-valued options.

Fla: --+CommandOptionLetter
Effect: Like the -+ command, but takes a long option name rather than a single option letter.

Fla: -!commandOptionLetter
Effect: Followed by one of the command line option letters, this will reset the option to the "opposite" of its default setting and print a message describing the new setting. This does not work for numeric or string-valued options.

Fla: -!LongCommandOption
Effect: Like the -! command, but takes a long option name rather than a single option letter.

Instruction: _commandLineLetterOption
Effect: Followed by one of the command line option letters, this will print a message describing the current setting of that option. The setting of the option is not changed.
Context: less

Instruction: __commandLineWordOption
Effect: Like the _ (underscore) command, but takes a long option name rather than a single option letter. You must press RETURN after typing the option name.
Context: less

Instruction: +cmd
Effect: Causes the specified cmd to be executed each time a new file is examined.
Context: less

Instruction: V
Effect: Prints the version number of less being run.
Context: less

Instruction: q or Q or :q or :Q or ZZ
Effect: Exits less.
Context: less

Instruction: v
Effect: Invokes an editor to edit the current file being viewed. The editor is taken from the environment variable VISUAL if defined, or EDITOR if VISUAL is not defined, or defaults to "vi" if neither VISUAL nor EDITOR is defined. See also the discussion of LESSEDIT under the section on PROMPTS below.
Context: less

Instruction: ! shell-command
Effect: Invokes a shell to run the shell-command given. On Unix systems, the shell is taken from the environment variable SHELL, or defaults to "sh". On MS-DOS and OS/2 systems, the shell is the normal command processor.
Context: less

Instruction: %
Effect: name of the current file
Context: less ! shell-command

Instruction: #
Effect: name of the previously examined file
Context: less ! shell-command

Instruction: !!
Effect: repeats the last shell command
Context: less ! shell-command

Instruction: !
Effect: invokes a shell
Context: less

Instruction: | foo shell-command
Effect: Pipes a section of the input file to the given shell command. The section of the file to be piped is between the first line on the current screen and the position marked by the letter. <m> may also be ^ or $ to indicate beginning or end of file respectively. If <m> is . or newline, the current screen is piped.
Context: less

Instruction: s filename
Effect: Save the input to a file. This only works if the input is a pipe, not an ordinary file.
Context: less

Fla: --help
Effect: This option displays a summary of the commands accepted by less (the same as the h command).
Flag abbreviation: -?

Fla: --search-skip-screen
Effect: Causes searches to start after the last line displayed on the screen, thus skipping all lines displayed on the screen. By default, searches start at the second line on the screen (or after the last found line; see the -j option).
Flag abbreviation: -a

Fla: --buffers=n
Effect: Specifies the amount of buffer space less will use for each file, in units of kilobytes (1024 bytes). By default 64K of buffer space is used for each file (unless the file is a pipe; see the -B option). The -b option specifies instead that n kilobytes of buffer space should be used for each file. If n is -1, buffer space is unlimited; that is, the entire file can be read into memory.
Flag abbreviation: -bn

Fla: --auto-buffers
Effect: Disable the automatic allocation of buffers for pipes, so that only 64K (or the amount of space specified by the -b option) is used for the pipe.
Flag abbreviation: -B
Extra: Warning: use of -B can result in erroneous display, since only the most recently viewed part of the piped data is kept in memory; any earlier data is lost.

Fla: --clear-screen
Effect: Causes full screen repaints to be painted from the top line down. By default, full screen repaints are done by scrolling from the bottom of the screen.
Flag abbreviation: -c

Fla: --dumb
Effect: The -d option suppresses the error message normally displayed if the terminal is dumb; that is, lacks some important capability, such as the ability to clear the screen or scroll backward. The -d option does not otherwise change the behavior of less on a dumb terminal.
Flag abbreviation: -d

Fla: --quit-at-eof
Effect: Causes less to automatically exit the second time it reaches end-of-file. By default, the only way to exit less is via the "q"
Flag abbreviation: -e

Fla: --QUIT-AT-EOF
Effect: Causes less to automatically exit the first time it reaches end-of-file.
Flag abbreviation: -E

Fla: --force
Effect: Forces non-regular files to be opened.
Flag abbreviation: -f
Extra: (A non-regular file is a directory or a device special file.) Also suppresses the warning message when a binary file is opened. By default, less will refuse to open non-regular files. Note that some operating systems will not allow directories to be read, even if -f is set.

Fla: --quit-if-one-screen
Effect: Causes less to automatically exit if the entire file can be displayed on the first screen.
Flag abbreviation: -F

Fla: --hilite-search
Effect: highlight only the particular string which was found by the last search command.
Flag abbreviation: -g
Extra: Normally, less will highlight ALL strings which match the last search command. This can cause less to run somewhat faster than the default.

Fla: HILITE-SEARCH
Effect: This option suppresses all highlighting of strings found by search commands.
Flag abbreviation: -G

Fla: --old-bot
Effect: Reverts to the old bottom of screen behavior. This can be sometimes desirable if the long lines are not wrapped correctly when reaching the bottom of the terminal, while scrolling forward.

Fla: --max-back-scroll=n
Effect: scroll backward up to n lines
Flag abbreviation: -hn
Extra: If it is necessary to scroll backward more than n lines, the screen is repainted in a forward direction instead. (If the terminal does not have the ability to scroll backward, -h0 is implied.)

Fla: --ignore-case
Effect: Causes searches to ignore case; that is, uppercase and lowercase are considered identical. This option is ignored if any uppercase letters appear in the search pattern; in other words, if a pattern contains uppercase letters, then that search does not ignore case.
Flag abbreviation: -i

Fla: --IGNORE-CASE
Effect: Like -i, but searches ignore case even if the pattern contains uppercase letters.
Flag abbreviation: -I

Fla: --jump-target=n
Effect: Specifies a line on the screen where the "target" line is to be positioned. The target line is the line specified by any command to search for a pattern, jump to a line number, jump to a file percentage or jump to a tag. The screen line may be specified by a number: the top line on the screen is 1, the next is 2, and so on. The number may be negative to specify a line relative to the bottom of the screen: the bottom line on the screen is -1, the second to the bottom is -2, and so on. Alternately, the screen line may be specified as a fraction of the height of the screen, starting with a decimal point: .5 is in the middle of the screen, .3 is three tenths down from the first line, and so on. If the line is specified as a fraction, the actual line number is recalculated if the terminal window is resized, so that the target line remains at the specified fraction of the screen height. If any form of the -j option is used, forward searches begin at the line immediately after the target line, and backward searches begin at the target line.
Flag abbreviation: -jn

Fla: --sattus-column
Effect: Displays a status column at the left edge of the screen. The status column shows the lines that matched the current search. The status column is also used if the -w or -W option is in effect.
Flag abbreviation: -J

Fla: --lesskey-file=filename
Effect: Causes less to open and interpret the named file as a lesskey (1) file. Multiple occurence of this options may be specified. If the LESSKEY or LESSKEY_SYSTEM environment variable is set, or if a lesskey file is found in a standard place (see KEY BINDINGS), it is also used as a lesskey file.
Flag abbreviation: -kfilename

Fla: --quit-on-intr
Effect: Causes less to exit immediately when an interrupt character (usually ^C) is typed. Normally, an interrupt character causes less to stop whatever it is doing and return to its command prompt. Note that use of this option makes it impossible to return to the command prompt from the "F" command.
Flag abbreviation: -K

Fla: --no-lessopen
Effect: Ignore the LESSOPEN environment variable (see the INPUT PREPROCESSOR section below). This option can be set from within less, but it will apply only to files opened subsequently, not to the file which is currently open.
Flag abbreviation: -L

Fla: --long-prompt
Effect: Causes less to prompt verbosely (like more), with the percent into the file. By default, less prompts with a colon.
Flag abbreviation: -m

Fla: --LONG-PROMPT
Effect: Causes less to prompt even more verbosely than more.
Flag abbreviation: -M

Fla: --line-numbers
Effect: Suppresses line numbers. The default (to use line numbers) may cause less to run more slowly in some cases, especially with a very large input file. Suppressing line numbers with the -n option will avoid this problem. Using line numbers means: the line number will be displayed in the verbose prompt and in the = command, and the v command will pass the current line number to the editor (see also the discussion of LESSEDIT in PROMPTS below).
Flag abbreviation: -n

Fla: --LINE-NUMBERS
Effect: Causes a line number to be displayed at the beginning of each line in the display.
Flag abbreviation: -N

Fla: --log-file=filename
Effect: Causes less to copy its input to the named file as it is being viewed. This applies only when the input file is a pipe, not an ordinary file. If the file already exists, less will ask for confirmation before overwriting it.
If no log file has been specified, this option can be used from within less to specify a log file. Without a file name, they will simply report the name of the log file.
Flag abbreviation: -ofilename

Fla: --LOG-FILE=filename
Effect: like -o, but it will overwrite an existing file without asking for confirmation.
Flag abbreviation: -Ofilename

Fla: --prompt=prompt
Effect: Provides a way to tailor the three prompt styles to your own preference. This option would normally be put in the LESS environment variable, rather than being typed in with each less command. Such an option must either be the last option in the LESS variable, or be terminated by a dollar sign. -Ps followed by a string changes the default (short) prompt to that string. -Pm changes the medium (-m) prompt. -PM changes the long (-M) prompt. -Ph changes the prompt for the help screen. -P= changes the message printed by the = command. -Pw changes the message printed while waiting for data (in the F command). All prompt strings consist of a sequence of letters and special escape sequences. See the section on PROMPTS for more details. (not in anki)
Flag abbreviation: -Pprompt

Fla: --quiet or --silent
Effect: Causes moderately "quiet" operation: the terminal bell is not rung if an attempt is made to scroll past the end of the file or before the beginning of the file. If the terminal has a "visual bell", it is used instead. The bell will be rung on certain other errors, such as typing an invalid character. The default is to ring the terminal bell in all such cases.
Flag abbreviation: -q

Fla: --QUIET or --SILENT
Effect: Causes totally "quiet" operation: the terminal bell is never rung.
Flag abbreviation: -Q

Fla: --raw-control-chars
Effect: Causes "raw" control characters to be displayed. The default is to display control characters using the caret notation; for example, a control-A (octal 001) is displayed as "^A". Warning: when the -r option is used, less cannot keep track of the actual appearance of the screen (since this depends on how the screen responds to each type of control character). Thus, various display problems may result, such as long lines being split in the wrong place.
Flag abbreviation: -r

Fla: --RAW-CONTROL-CHARS
Effect: Like -r, but only ANSI "color" escape sequences are output in "raw" form. Unlike -r, the screen appearance is maintained correctly in most cases.
Flag abbreviation: -R

Instruction: ESC [ ... m where the "..." is zero or more color specification characters
Effect: ANSI "color" escape sequences
Context: less

Fla: --squeeze-blank-lines
Effect: Causes consecutive blank lines to be squeezed into a single blank line. This is useful when viewing nroff output.
Flag abbreviation: -s

Fla: --chop-long-lines
Effect: Causes lines longer than the screen width to be chopped rather than folded. That is, the portion of a long line that does not fit in the screen width is not shown. The default is to fold long lines; that is, display the remainder on the next line.
Flag abbreviation: -S

Fla: --tag=tag
Effect: edit the file containing that tag. For this to work, tag information must be available; for example, there may be a file in the current directory called "tags", which was previously built by ctags (1) or an equivalent command. If the environment variable LESSGLOBALTAGS is set, it is taken to be the name of a command compatible with global (1), and that command is executed to find the tag. (See http://www.gnu.org/software/global/global.html).
Flag abbreviation: -ttag

Fla: --tag-file=tagsfile
Effect: Specifies a tags file to be used instead of "tags".
Flag abbreviation: -Ttagsfile

Fla: --underline-special
Effect: Causes backspaces and carriage goes back to be treated as printable characters; that is, they are sent to the terminal when they appear in the input.
Flag abbreviation: -u

Fla: --UNDERLINE-SPECIAL
Effect: Causes backspaces, tabs and carriage goes back to be treated as control characters; that is, they are handled as specified by the -r option.
Flag abbreviation: -U

Instruction: backspaces which appear adjacent to an underscore character
Effect: the underlined text is displayed using the terminal's hardware underlining capability
Context: less
Assuming: neither -u nor -U is given

Instruction: backspaces which appear between two identical characters
Effect: the overstruck text is printed using the terminal's hardware boldface capability
Context: less
Assuming: neither -u nor -U is given

Instruction: backspaces
Effect: deleted character, along with the preceding character
Context: less

Instruction: Carriage returns immediately followed by a newline
Effect: deleted
Context: less

Fla: --version
Effect: Displays the version number of less.
Flag abbreviation: -V

Fla: --hilite-unread
Effect: Temporarily highlights the first "new" line after a forward movement of a full page. The first "new" line is the line immediately following the line previously at the bottom of the screen. Also highlights the target line after a g or p command. The highlight is removed at the next command which causes movement. The entire line is highlighted, unless the -J option is in effect, in which case only the status column is highlighted.
Flag abbreviation: -w

Fla: --HILITE-UNREAD
Effect: Like -w, but temporarily highlights the first new line after any forward movement command larger than one line.
Flag abbreviation: -W

Fla: --tabs=n,...
Effect: Sets tab stops. If only one n is specified, tab stops are set at multiples of n. If multiple values separated by commas are specified, tab stops are set at those positions, and then continue with the same spacing as the last two.
Flag abbreviation: -xn,...

Fla: --no-init
Effect: Disables sending the termcap initialization and deinitialization strings to the terminal. This is sometimes desirable if the deinitialization string does something unnecessary, like clearing the screen.
Flag abbreviation: -X

Fla: --max-forw-scroll=n
Effect: Specifies a maximum number of lines to scroll forward. If it is necessary to scroll forward more than n lines, the screen is repainted instead. The -c or -C option may be used to repaint from the top of the screen if desired. By default, any forward movement causes scrolling.
Flag abbreviation: -yn

Fla: --window=n
Effect: Changes the default scrolling window size to n lines. The default is one screenful. The z and w commands can also be used to change the window size. The "z" may be omitted for compatibility with some versions of more. If the number n is negative, it indicates n lines less than the current screen size. For example, if the screen is 24 lines, -z-4 sets the scrolling window to 20 lines. If the screen is resized to 40 lines, the scrolling window automatically changes to 36 lines.
Flag abbreviation: -[z]n

Fla: --quotes=cc
Effect: Changes the filename quoting character. This may be necessary if you are trying to name a file which contains both spaces and quote characters. Followed by a single character, this changes the quote character to that character. Filenames containing a space should then be surrounded by that character rather than by double quotes. Followed by two characters, changes the open quote to the first character, and the close quote to the second character. Filenames containing a space should then be preceded by the open quote character and followed by the close quote character. Note that even after the quote characters are changed, this option remains -" (a dash followed by a double quote).
Flag abbreviation: -dqcc

Fla: --tilde
Effect: Normally lines after end of file are displayed as a single tilde (~). This option causes lines after end of file to be displayed as blank lines.
Flag abbreviation: -~

Fla: --shift
Effect: Specifies the default number of positions to scroll horizontally in the RIGHTARROW and LEFTARROW commands. If the number specified is zero, it sets the default number of positions to one half of the screen width. Alternately, the number may be specified as a fraction of the width of the screen, starting with a decimal point: .5 is half of the screen width, .3 is three tenths of the screen width, and so on. If the number is specified as a fraction, the actual number of scroll positions is recalculated if the terminal window is resized, so that the actual scroll remains at the specified fraction of the screen width.
Flag abbreviation: -#

Fla: --no-keypad
Effect: Disables sending the keypad initialization and deinitialization strings to the terminal. This is sometimes useful if the keypad strings make the numeric keypad behave in an undesirable manner.

Fla: --follow-name
Effect: Normally, if the input file is renamed while an F command is executing, less will continue to display the contents of the original file despite its name change. If --follow-name is specified, during an F command less will periodically attempt to reopen the file by name. If the reopen succeeds and the file is a different file from the original (which means that a new file has been created with the same name as the original (now renamed) file), less will display the contents of that new file.

Fla: --
Effect: the end of option arguments. Any arguments following this are interpreted as filenames. This can be useful when viewing a file whose name begins with a "-" or "+".

Effect: command is taken to be an initial command to less.
Context: less
Abbreviation: +command

Variable: lessopen
Meaning: A string, containing a %s
This string is an instruction, called by less, with %s replaced by the name of the files to be opened. This instruction should return the name of a file.
If the variable begin by |, less prints the standard output of this command
Otherwise, less assume the command's output - if it exists- is a name of a file, and show this files
Otherwise less print the original file
If first letter is -, the command is also used on standard input

Variable: LESSCLOSE
Meaning: A command, with two %s
When less close, it calls this argument, with first %s being replaced by the name of less argument, and the second %s replaced by the name of the file given by LESSOPEN command

Variable: LESSSECURE
Meaning: If its value is 1, less runs in a "secure" mode, disabling !, |, :e, v, s, -o, -k, -t, * in filename, autocompletion

Variable: EDITOR
Meaning: The name of the editor (used for the v command).

Variable: COLUMNS
Meaning: Sets the number of columns on the screen. Takes precedence over the number of columns specified by the TERM variable. (But if you have a windowing system which supports TIOCGWINSZ or WIOCGETD, the window system's idea of the screen size takes precedence over the LINES and COLUMNS environment variables.)

Variable: HOME
Meaning: Name of the user's home directory (used to find a lesskey file on Unix and OS/2 systems).

Variable: HOMEDRIVE, HOMEPATH
Meaning: Concatenation of the HOMEDRIVE and HOMEPATH environment variables is the name of the user's home directory if the HOME variable is not set (only in the Windows version).

Variable: INIT
Meaning: Name of the user's init directory (used to find a lesskey file on OS/2 systems).

Variable: LANG
Meaning: Language for determining the character set.

Variable: LC_CTYPE
Meaning: Language for determining the character set.

Variable: LESS
Meaning: Options which are passed to less automatically.

Variable: LESSANSIENDCHARS
Meaning: Characters which may end an ANSI color escape sequence (default "m").

Variable: LESSANSIMIDCHARS
Meaning: Characters which may appear between the ESC character and the end character in an ANSI color escape sequence (default "0123456789;[?!"'#%()*+ ".

Variable: LESSBINFMT
Meaning: Format for displaying non-printable, non-control characters.

Variable: LESSCHARDEF
Meaning: Defines a character set.

Variable: LESSCHARSET
Meaning: Selects a predefined character set. (see man for predefined one, not in anki)

Variable: LESSCLOSE
Meaning: Command line to invoke the (optional) input-postprocessor.

Variable: LESSECHO
Meaning: Name of the lessecho program (default "lessecho"). The lessecho program is needed to expand metacharacters, such as * and ?, in filenames on Unix systems.

Variable: LESSEDIT
Meaning: Editor prototype string (used for the v command). See discussion under PROMPTS.

Variable: LESSGLOBALTAGS
Meaning: Name of the command used by the -t option to find global tags. Normally should be set to "global" if your system has the global (1) command. If not set, global tags are not used.

Variable: LESSHISTFILE
Meaning: Name of the history file used to remember search commands and shell commands between invocations of less. If set to "-" or "/dev/null", a history file is not used. The default is "$HOME/.lesshst" on Unix systems, "$HOME/_lesshst" on DOS and Windows systems, or "$HOME/lesshst.ini" or "$INIT/lesshst.ini" on OS/2 systems.

Variable: LESSHISTSIZE
Meaning: The maximum number of commands to save in the history file. The default is 100.

Variable: LESSKEY
Meaning: Name of the default lesskey(1) file.

Variable: LESSKEY_SYSTEM
Meaning: Name of the default system-wide lesskey(1) file.

Variable: LESSMETACHARS
Meaning: List of characters which are considered "metacharacters" by the shell.

Variable: LESSMETAESCAPE
Meaning: Prefix which less will add before each metacharacter in a command sent to the shell. If LESSMETAESCAPE is an empty string, commands containing metacharacters will not be passed to the shell.

Variable: LESSSEPARATOR
Meaning: String to be appended to a directory name in filename completion.

Variable: LESSUTFBINFMT
Meaning: Format for displaying non-printable Unicode code points.

Variable: LESS_IS_MORE
Meaning: Emulate the more (1) command.

Variable: LINES
Meaning: Sets the number of lines on the screen. Takes precedence over the number of lines specified by the TERM variable. (But if you have a windowing system which supports TIOCGWINSZ or WIOCGETD, the window system's idea of the screen size takes precedence over the LINES and COLUMNS environment variables.)

Variable: PATH
Meaning: User's search path (used to find a lesskey file on MS-DOS and OS/2 systems).

Variable: SHELL
Meaning: The shell used to execute the ! command, as well as to expand filenames.

Variable: TERM
Meaning: The type of terminal on which less is being run.

Variable: VISUAL
Meaning: The name of the editor (used for the v command).

Instruction: less listFiles
Effect: file perusal filter for crt viewing
Uses the options in LESS variable environment

Instruction: h or H
Effect: Help: display a summary of these commands. If you forget all the other commands, remember this one.
Context: less

Instruction: space ^V f ^F
Effect: Scroll forward N lines, default one window (see option -z below). If N is more than the screen size, only the final screenful is displayed. Warning: some systems use ^V as a special literalization character.
Context: less

Instruction: z
Effect: Like SPACE, but if N is specified, it becomes the new window size
Context: less

Instruction: ESC-SPACE
Effect: Like SPACE, but scrolls a full screenful, even if it reaches end-of-file in the process.
Context: less

Instruction: RETURN or ^N or e or ^E or j or ^J
Effect: Scroll forward N lines, default 1. The entire N lines are displayed, even if N is more than the screen size.
Context: less

Instruction: d or ^D
Effect: Scroll forward N lines, default one half of the screen size. If N is specified, it becomes the new default for subsequent d and u commands.
Context: less

Instruction: b or ^B or ESC-v
Effect: Scroll backward N lines, default one window (see option -z below). If N is more than the screen size, only the final screenful is displayed.
Context: less

Instruction: w
Effect: Scroll backward N lines. If N is specified, it becomes the new window size. Otherwise N=one windows
Context: less

Instruction: y or ^Y or ^P or k or ^K
Effect: Scroll backward N lines, (default 1).
Context: less
Extra: The entire N lines are displayed, even if N is more than the screen size. Warning: some systems use ^Y as a special job control character

Instruction: u or ^U
Effect: Scroll backward N lines, default one half of the screen size. If N is specified, it becomes the new default for subsequent d and u commands.
Context: less

Instruction: ESC-) or RIGHTARROW
Effect: Scroll horizontally right N characters, default half the screen width (see the -# option). If a number N is specified, it becomes the default for future RIGHTARROW and LEFTARROW commands. While the text is scrolled, it acts as though the -S option (chop lines) were in effect.
Context: less

Instruction: Scroll horizontally left N characters,
  default half the screen width (
  see the -# option
). If a number N is specified,
  it becomes the default for future RIGHTARROW and LEFTARROW commands.
Effect: ESC-( or LEFTARROW
Context: less

Instruction: Repaint the screen.
Effect: r or ^R or ^L
Context: less

Instruction: R
Effect: Repaint the screen, discarding any buffered input. Useful if the file is changing while it is being viewed.
Context: less

Instruction: F
Effect: Scroll forward, and keep trying to read when the end of file is reached. Normally this command would be used when already at the end of the file. It is a way to monitor the tail of a file which is growing while it is being viewed. (The behavior is similar to the "tail -f" command.)
Context: less

Instruction: g or < or ESC-<
Effect: Go to line N in the file, default 1 (beginning of file). (Warning: this may be slow if N is large.)
Context: less

Instruction: G or > or ESC->
Effect: Go to line N in the file, default the end of the file. (Warning: this may be slow if N is large, or if N is not specified and standard input, rather than a file, is being read.)
Context: less

Instruction: p or %
Effect: Go to a position N percent into the file. N should be between 0 and 100, and may contain a decimal point.
Context: less

Instruction: P
Effect: Go to the line containing byte offset N in the file.
Context: less

Instruction: { ( [
Effect: If a left curly bracket (parenthesis, brackets) appears in the top line displayed on the screen, the { command will go to the matching right curly bracket. The matching right curly bracket is positioned on the bottom line of the screen. If there is more than one left curly bracket on the top line, a number N may be used to specify the N-th bracket on the line.If a left curly bracket appears in the top line displayed on the screen, the { command will go to the matching right curly bracket. The matching right curly bracket is positioned on the bottom line of the screen. If there is more than one left curly bracket on the top line, a number N may be used to specify the N-th bracket on the line.
Context: less

Instruction: } ) ]
Effect: If a right curly (parenthesis, brackets) bracket appears in the bottom line displayed on the screen, the } command will go to the matching left curly bracket. The matching left curly bracket is positioned on the top line of the screen. If there is more than one right curly bracket on the top line, a number N may be used to specify the N-th bracket on the line.
Context: less

Instruction: ESC-^F
Effect: Followed by two characters, acts like {, but uses the two characters as open and close brackets, respectively.
Context: less

Instruction: ESC-^B
Effect: Followed by two characters, acts like }, but uses the two characters as open and close brackets, respectively.
Context: less

Instruction: m
Effect: Followed by any lowercase letter, marks the current position with that letter.
Context: less

Instruction: 'c
Effect: Goes back to the position which was previously marked with c
Context: less
Variables: c a character
Extra: Marks are preserved when a new file is examined, so the ' command can be used to switch between input files.

Instruction: ''
Effect: Goes back to the position at which the last "large" movement command was executed.
Context: less

Instruction: '$
Effect: Jumps to the end of the file respectively.
Context: less

Instruction: '^
Effect: Jumps to the beginning of the file respectively.
Context: less

Instruction: /pattern
Effect: Search forward in the file for the N-th line containing the pattern. N defaults to 1. The pattern is a regular expression, as recognized by the regular expression library supplied by your system. The search starts at the second line displayed (but see the -a and -j options, which change this).
Certain characters are special if entered at the beginning of the pattern; they modify the type of search rather than become part of the pattern:
Context: less

Instruction: ^N or !
Effect: Search for lines which do NOT match the pattern.
Context: less pattern

Instruction: ^E or *
Effect: Search multiple files. That is, if the search reaches the END of the current file without finding a match, the search continues in the next file in the command line list.
Context: less pattern

Instruction: ^F or @
Effect: Begin the search at the first line of the FIRST file in the command line list
Context: less pattern
Extra: regardless of what is currently displayed on the screen or the settings of the -a or -j options.

Instruction: ^K
Effect: Highlight any text which matches the pattern on the current screen, but don't move to the first match (KEEP current position).
Context: less pattern

Instruction: ^R
Effect: Don't interpret regular expression metacharacters; that is, do a simple textual comparison.
Context: less pattern

Instruction: ?pattern
Effect: Search backward in the file for the N-th line containing the pattern. The search starts at the line immediately before the top line displayed.
Context: less