160786Sps 260786Sps SSUUMMMMAARRYY OOFF LLEESSSS CCOOMMMMAANNDDSS 360786Sps 460786Sps Commands marked with * may be preceded by a number, _N. 560786Sps Notes in parentheses indicate the behavior if _N is given. 6238730Sdelphij A key preceded by a caret indicates the Ctrl key; thus ^K is ctrl-K. 760786Sps 860786Sps h H Display this help. 960786Sps q :q Q :Q ZZ Exit. 1060786Sps --------------------------------------------------------------------------- 1160786Sps 1260786Sps MMOOVVIINNGG 1360786Sps 1460786Sps e ^E j ^N CR * Forward one line (or _N lines). 1560786Sps y ^Y k ^K ^P * Backward one line (or _N lines). 1660786Sps f ^F ^V SPACE * Forward one window (or _N lines). 1760786Sps b ^B ESC-v * Backward one window (or _N lines). 1860786Sps z * Forward one window (and set window to _N). 1960786Sps w * Backward one window (and set window to _N). 2060786Sps ESC-SPACE * Forward one window, but don't stop at end-of-file. 2160786Sps d ^D * Forward one half-window (and set half-window to _N). 2260786Sps u ^U * Backward one half-window (and set half-window to _N). 23330571Sdelphij ESC-) RightArrow * Right one half screen width (or _N positions). 24330571Sdelphij ESC-( LeftArrow * Left one half screen width (or _N positions). 25330571Sdelphij ESC-} ^RightArrow Right to last column displayed. 26330571Sdelphij ESC-{ ^LeftArrow Left to first column. 2760786Sps F Forward forever; like "tail -f". 28294286Sdelphij ESC-F Like F but stop when search pattern is found. 2960786Sps r ^R ^L Repaint screen. 3060786Sps R Repaint screen, discarding buffered input. 3160786Sps --------------------------------------------------- 3260786Sps Default "window" is the screen height. 3360786Sps Default "half-window" is half of the screen height. 3460786Sps --------------------------------------------------------------------------- 3560786Sps 3660786Sps SSEEAARRCCHHIINNGG 3760786Sps 3860786Sps /_p_a_t_t_e_r_n * Search forward for (_N-th) matching line. 3960786Sps ?_p_a_t_t_e_r_n * Search backward for (_N-th) matching line. 4060786Sps n * Repeat previous search (for _N-th occurrence). 4160786Sps N * Repeat previous search in reverse direction. 4260786Sps ESC-n * Repeat previous search, spanning files. 4360786Sps ESC-N * Repeat previous search, reverse dir. & spanning files. 4460786Sps ESC-u Undo (toggle) search highlighting. 45191930Sdelphij &_p_a_t_t_e_r_n * Display only matching lines 4660786Sps --------------------------------------------------- 47237613Sdelphij A search pattern may be preceded by one or more of: 4860786Sps ^N or ! Search for NON-matching lines. 4960786Sps ^E or * Search multiple files (pass thru END OF FILE). 5060786Sps ^F or @ Start search at FIRST file (for /) or last file (for ?). 5160786Sps ^K Highlight matches, but don't move (KEEP position). 5260786Sps ^R Don't use REGULAR EXPRESSIONS. 5360786Sps --------------------------------------------------------------------------- 5460786Sps 5560786Sps JJUUMMPPIINNGG 5660786Sps 5760786Sps g < ESC-< * Go to first line in file (or line _N). 5860786Sps G > ESC-> * Go to last line in file (or line _N). 5960786Sps p % * Go to beginning of file (or _N percent into file). 6089019Sps t * Go to the (_N-th) next tag. 6189019Sps T * Go to the (_N-th) previous tag. 6260786Sps { ( [ * Find close bracket } ) ]. 6360786Sps } ) ] * Find open bracket { ( [. 6460786Sps ESC-^F _<_c_1_> _<_c_2_> * Find close bracket _<_c_2_>. 6560786Sps ESC-^B _<_c_1_> _<_c_2_> * Find open bracket _<_c_1_> 6660786Sps --------------------------------------------------- 6760786Sps Each "find close bracket" command goes forward to the close bracket 6860786Sps matching the (_N-th) open bracket in the top line. 6960786Sps Each "find open bracket" command goes backward to the open bracket 7060786Sps matching the (_N-th) close bracket in the bottom line. 7160786Sps 72330571Sdelphij m_<_l_e_t_t_e_r_> Mark the current top line with <letter>. 73330571Sdelphij M_<_l_e_t_t_e_r_> Mark the current bottom line with <letter>. 7460786Sps '_<_l_e_t_t_e_r_> Go to a previously marked position. 7560786Sps '' Go to the previous position. 7660786Sps ^X^X Same as '. 77330571Sdelphij ESC-M_<_l_e_t_t_e_r_> Clear a mark. 7860786Sps --------------------------------------------------- 7960786Sps A mark is any upper-case or lower-case letter. 8060786Sps Certain marks are predefined: 8160786Sps ^ means beginning of the file 8260786Sps $ means end of the file 8360786Sps --------------------------------------------------------------------------- 8460786Sps 8560786Sps CCHHAANNGGIINNGG FFIILLEESS 8660786Sps 8760786Sps :e [_f_i_l_e] Examine a new file. 8860786Sps ^X^V Same as :e. 8960786Sps :n * Examine the (_N-th) next file from the command line. 9060786Sps :p * Examine the (_N-th) previous file from the command line. 9160786Sps :x * Examine the first (or _N-th) file from the command line. 9260786Sps :d Delete the current file from the command line list. 9360786Sps = ^G :f Print current file name. 9460786Sps --------------------------------------------------------------------------- 9560786Sps 9660786Sps MMIISSCCEELLLLAANNEEOOUUSS CCOOMMMMAANNDDSS 9760786Sps 9860786Sps -_<_f_l_a_g_> Toggle a command line option [see OPTIONS below]. 9960786Sps --_<_n_a_m_e_> Toggle a command line option, by name. 10060786Sps __<_f_l_a_g_> Display the setting of a command line option. 10160786Sps ___<_n_a_m_e_> Display the setting of an option, by name. 10260786Sps +_c_m_d Execute the less cmd each time a new file is examined. 10360786Sps 10460786Sps !_c_o_m_m_a_n_d Execute the shell command with $SHELL. 10560786Sps |XX_c_o_m_m_a_n_d Pipe file between current pos & mark XX to shell command. 106330571Sdelphij s _f_i_l_e Save input to a file. 10760786Sps v Edit the current file with $VISUAL or $EDITOR. 10860786Sps V Print version number of "less". 10960786Sps --------------------------------------------------------------------------- 11060786Sps 11160786Sps OOPPTTIIOONNSS 11260786Sps 11360786Sps Most options may be changed either on the command line, 11460786Sps or from within less by using the - or -- command. 11560786Sps Options may be given in one of two forms: either a single 116250592Sdelphij character preceded by a -, or a name preceded by --. 11760786Sps 11860786Sps -? ........ --help 11960786Sps Display help (from command line). 12060786Sps -a ........ --search-skip-screen 121237613Sdelphij Search skips current screen. 122221715Sdelphij -A ........ --SEARCH-SKIP-SCREEN 123237613Sdelphij Search starts just after target line. 12460786Sps -b [_N] .... --buffers=[_N] 12560786Sps Number of buffers. 12660786Sps -B ........ --auto-buffers 12760786Sps Don't automatically allocate buffers for pipes. 128170256Sdelphij -c ........ --clear-screen 129170256Sdelphij Repaint by clearing rather than scrolling. 13060786Sps -d ........ --dumb 13160786Sps Dumb terminal. 13260786Sps -D [_x_n_._n] . --color=_x_n_._n 13360786Sps Set screen colors. (MS-DOS only) 13460786Sps -e -E .... --quit-at-eof --QUIT-AT-EOF 13560786Sps Quit at end of file. 13660786Sps -f ........ --force 13760786Sps Force open non-regular files. 13860786Sps -F ........ --quit-if-one-screen 13960786Sps Quit if entire file fits on first screen. 14060786Sps -g ........ --hilite-search 14160786Sps Highlight only last match for searches. 14260786Sps -G ........ --HILITE-SEARCH 14360786Sps Don't highlight any matches for searches. 14460786Sps -h [_N] .... --max-back-scroll=[_N] 14560786Sps Backward scroll limit. 14660786Sps -i ........ --ignore-case 14760786Sps Ignore case in searches that do not contain uppercase. 14860786Sps -I ........ --IGNORE-CASE 14960786Sps Ignore case in all searches. 15060786Sps -j [_N] .... --jump-target=[_N] 15160786Sps Screen position of target lines. 15263128Sps -J ........ --status-column 15363128Sps Display a status column at left edge of screen. 15460786Sps -k [_f_i_l_e] . --lesskey-file=[_f_i_l_e] 15560786Sps Use a lesskey file. 156221715Sdelphij -K --quit-on-intr 157221715Sdelphij Exit less in response to ctrl-C. 158128345Stjr -L ........ --no-lessopen 159128345Stjr Ignore the LESSOPEN environment variable. 16060786Sps -m -M .... --long-prompt --LONG-PROMPT 16160786Sps Set prompt style. 16260786Sps -n -N .... --line-numbers --LINE-NUMBERS 163170256Sdelphij Don't use line numbers. 16460786Sps -o [_f_i_l_e] . --log-file=[_f_i_l_e] 16560786Sps Copy to log file (standard input only). 16660786Sps -O [_f_i_l_e] . --LOG-FILE=[_f_i_l_e] 16760786Sps Copy to log file (unconditionally overwrite). 16860786Sps -p [_p_a_t_t_e_r_n] --pattern=[_p_a_t_t_e_r_n] 16960786Sps Start at pattern (from command line). 17060786Sps -P [_p_r_o_m_p_t] --prompt=[_p_r_o_m_p_t] 17160786Sps Define new prompt. 17260786Sps -q -Q .... --quiet --QUIET --silent --SILENT 17360786Sps Quiet the terminal bell. 17460786Sps -r -R .... --raw-control-chars --RAW-CONTROL-CHARS 17560786Sps Output "raw" control characters. 17660786Sps -s ........ --squeeze-blank-lines 17760786Sps Squeeze multiple blank lines. 17860786Sps -S ........ --chop-long-lines 179237613Sdelphij Chop (truncate) long lines rather than wrapping. 18060786Sps -t [_t_a_g] .. --tag=[_t_a_g] 18160786Sps Find a tag. 18260786Sps -T [_t_a_g_s_f_i_l_e] --tag-file=[_t_a_g_s_f_i_l_e] 18360786Sps Use an alternate tags file. 18460786Sps -u -U .... --underline-special --UNDERLINE-SPECIAL 18560786Sps Change handling of backspaces. 18660786Sps -V ........ --version 18760786Sps Display the version number of "less". 18860786Sps -w ........ --hilite-unread 18960786Sps Highlight first new line after forward-screen. 19060786Sps -W ........ --HILITE-UNREAD 19160786Sps Highlight first new line after any forward movement. 19289019Sps -x [_N[,...]] --tabs=[_N[,...]] 19360786Sps Set tab stops. 19460786Sps -X ........ --no-init 19560786Sps Don't use termcap init/deinit strings. 19660786Sps -y [_N] .... --max-forw-scroll=[_N] 19760786Sps Forward scroll limit. 19860786Sps -z [_N] .... --window=[_N] 19960786Sps Set size of window. 20060786Sps -" [_c[_c]] . --quotes=[_c[_c]] 20160786Sps Set shell quote characters. 20260786Sps -~ ........ --tilde 20360786Sps Don't display tildes after end of file. 20463128Sps -# [_N] .... --shift=[_N] 20563128Sps Horizontal scroll amount (0 = one half screen width) 206221715Sdelphij ........ --no-keypad 207237613Sdelphij Don't send termcap keypad init/deinit strings. 208221715Sdelphij ........ --follow-name 209221715Sdelphij The F command changes files if the input file is renamed. 210294286Sdelphij ........ --use-backslash 211294286Sdelphij Subsequent options use backslash as escape char. 21263128Sps 213221715Sdelphij 21460786Sps --------------------------------------------------------------------------- 21560786Sps 21660786Sps LLIINNEE EEDDIITTIINNGG 21760786Sps 21860786Sps These keys can be used to edit text being entered 21960786Sps on the "command line" at the bottom of the screen. 22060786Sps 221294286Sdelphij RightArrow ..................... ESC-l ... Move cursor right one character. 222294286Sdelphij LeftArrow ...................... ESC-h ... Move cursor left one character. 223294286Sdelphij ctrl-RightArrow ESC-RightArrow ESC-w ... Move cursor right one word. 224294286Sdelphij ctrl-LeftArrow ESC-LeftArrow ESC-b ... Move cursor left one word. 225294286Sdelphij HOME ........................... ESC-0 ... Move cursor to start of line. 226294286Sdelphij END ............................ ESC-$ ... Move cursor to end of line. 227294286Sdelphij BACKSPACE ................................ Delete char to left of cursor. 228294286Sdelphij DELETE ......................... ESC-x ... Delete char under cursor. 229294286Sdelphij ctrl-BACKSPACE ESC-BACKSPACE ........... Delete word to left of cursor. 230294286Sdelphij ctrl-DELETE .... ESC-DELETE .... ESC-X ... Delete word under cursor. 231294286Sdelphij ctrl-U ......... ESC (MS-DOS only) ....... Delete entire line. 232294286Sdelphij UpArrow ........................ ESC-k ... Retrieve previous command line. 233294286Sdelphij DownArrow ...................... ESC-j ... Retrieve next command line. 234294286Sdelphij TAB ...................................... Complete filename & cycle. 235294286Sdelphij SHIFT-TAB ...................... ESC-TAB Complete filename & reverse cycle. 236294286Sdelphij ctrl-L ................................... Complete filename, list all. 23760786Sps 238170256Sdelphij 239