-->
Previous Table of Contents Next


COMMANDS

h Displays Help information.
Space, Ctrl-V,
f, Ctrl-F
Scrolls forward the default number of lines (one window; this can be changed by the -z option)..
z num Scrolls forward the default number of lines; if num is specified, then it becomes the new window size.
Enter, Ctrl-N, e,
Ctrl-E, j, Ctrl-J
Scrolls forward one line.
d, Ctrl-D num Scrolls forward one-half of the screen; if num is specified, less scrolls forward that number of lines, and it becomes the default.
b, Ctrl-B, Esc-v Scrolls backward the default number of lines (one window; this can be changed by the -z option or w command).
w num Scrolls backward the default number of lines (one window; this can be changed by specifying num).
y, Ctrl-Y, Ctrl-P,
k, Ctrl-K
Scrolls backward the default number of lines (one).
u, Ctrl-U num Scrolls backward the default number of lines (one-half of one screen). If num is specified, it becomes the default for the d and u commands.
r, Ctrl-R, Ctrl-L Redraws the screen.
R Redraws the screen and discards the input in the buffer.
F Scrolls forward, even when the end of the file is reached (similar to tail -f).
g, <, Esc-< Scrolls to the beginning of the file.
G, >, Esc-> Scrolls to the end of the file.
p, % num Scrolls to a position num percent into the file. Num must be between 0 and 100.
{ Scrolls to the matching } if { appears in the top line of the screen.
} Scrolls back to the matching { if } appears in the top line of the screen.
( Scrolls to the matching ) if ( appears in the top line of the screen.
) Scrolls back to the matching ( if ) appears in the top line of the screen.
[ Scrolls to the matching ] if [ appears in the top line of the screen.
] Scrolls back to the matching [ if ] appears in the top line of the screen.
Esc-Ctrl-F
the char1 char2
Scrolls to the matching char2 if char1 appears in top line of the screen.
Esc-Ctrl-B
char1 char2
Scrolls back to the matching char1 if char2 appears in the top line of the screen.
m letter Marks the current position with lowercase letter.
letter Returns to the position marked with lowercase letter.
Ctrl-X Ctrl-X Returns to the position marked with lowercase letter.
/pattern Searches for next occurrence of pattern, starting at the second displayed line.
/!pattern Searches for lines that do not contain pattern.
/*pattern Searches for next occurrence of pattern, starting at the second displayed line, and extending the search through the next files in the command-line list.
/@pattern Searches for next occurrence of pattern, starting at the first line of the first file listed on the command line.
?pattern Searches backward in the file for the next occurrence of pattern, starting with the line immediately before the top line of the screen.
?!pattern Searches backward for lines that do not contain pattern.
?*pattern Searches backward for next occurrence of pattern, starting at the line immediately before the top line of the screen, and extending the search backwards through the previous files in the command-line list.
?@pattern Searches for next occurrence of pattern, starting at the last line of the last file listed on the command line.
Esc-/pattern Searches for next occurrence of pattern, starting at the second displayed line, and extending the search through the next files in the command-line list.
Esc-*pattern Searches backward for next occurrence of pattern, starting at the line immediately before the top line of the screen, and extending the search backwards through the previous files in the command-line list.
n Repeats the previous search.
N Repeats the previous search, but in the reverse direction.
Esc-n Repeats the previous search and extends the search to files specified on the command line.
Esc-N Repeats the previous search, but in the reverse direction, and extends the search to files specified on the command line.
Esc-u Turns off highlighting of patterns matched by the searches.
:e filename Opens a new filename. If no new file is specified, the current file is reloaded.
Ctrl-X, Ctrl-V,
E filename
Opens a new filename. If no new file is specified, the current file is reloaded.
:n num Opens the next file on the command line. If num is present, then that number of file(s) on the command line will be opened.
:p num Opens the previous file on the command line. If num is present, then that number of previous file on the command line will be opened.
:x num Opens the first file on the command line. If num is present, then that number of file on the command line will be opened.
=, Ctrl-G, :f Returns information about the file being viewed: name, line number, byte offset of the bottom line being displayed, length of the file, the number of lines in the file and the percent of the file above the last displayed line.
-option Changes a command-line option while less is running. If a value is required, you are asked for it; if no new value is entered, the current value is displayed.
-+option Resets a command-line option to default value.
--option Resets a command-line option to the opposite of the default value. Useless when working with options that require numerical or string-based input.
_option Returns the current value of option.
+command Runs command every time a new file is loaded.
V Prints version number.
q, :q, :Q, ZZ Quits less.
v Launches an editor (defined by VISUAL or EDITOR) to edit the current file.
! shell-command Runs the specified shell-command. To list the current file in the command, use the percent sign (%). To list the previously viewed command in the command line, use the pound sign (#). To repeat the previous shell command, use !! . To launch a shell with no command, use ! .
| mark_letter
shell-command
Uses mark_letter to send a section of the file via pipe to the specified shell-command. (Use the m letter command to mark a file.) The beginning of the section is the top of the screen, while the end of the section is the mark-letter.


Previous Table of Contents Next