1*bd4fcc09Stron 2*bd4fcc09Stron SSUUMMMMAARRYY OOFF LLEESSSS CCOOMMMMAANNDDSS 3*bd4fcc09Stron 4*bd4fcc09Stron Commands marked with * may be preceded by a number, _N. 5*bd4fcc09Stron Notes in parentheses indicate the behavior if _N is given. 6*bd4fcc09Stron 7*bd4fcc09Stron h H Display this help. 8*bd4fcc09Stron q :q Q :Q ZZ Exit. 9*bd4fcc09Stron --------------------------------------------------------------------------- 10*bd4fcc09Stron 11*bd4fcc09Stron MMOOVVIINNGG 12*bd4fcc09Stron 13*bd4fcc09Stron e ^E j ^N CR * Forward one line (or _N lines). 14*bd4fcc09Stron y ^Y k ^K ^P * Backward one line (or _N lines). 15*bd4fcc09Stron f ^F ^V SPACE * Forward one window (or _N lines). 16*bd4fcc09Stron b ^B ESC-v * Backward one window (or _N lines). 17*bd4fcc09Stron z * Forward one window (and set window to _N). 18*bd4fcc09Stron w * Backward one window (and set window to _N). 19*bd4fcc09Stron ESC-SPACE * Forward one window, but don't stop at end-of-file. 20*bd4fcc09Stron d ^D * Forward one half-window (and set half-window to _N). 21*bd4fcc09Stron u ^U * Backward one half-window (and set half-window to _N). 22*bd4fcc09Stron ESC-) RightArrow * Left one half screen width (or _N positions). 23*bd4fcc09Stron ESC-( LeftArrow * Right one half screen width (or _N positions). 24*bd4fcc09Stron F Forward forever; like "tail -f". 25*bd4fcc09Stron r ^R ^L Repaint screen. 26*bd4fcc09Stron R Repaint screen, discarding buffered input. 27*bd4fcc09Stron --------------------------------------------------- 28*bd4fcc09Stron Default "window" is the screen height. 29*bd4fcc09Stron Default "half-window" is half of the screen height. 30*bd4fcc09Stron --------------------------------------------------------------------------- 31*bd4fcc09Stron 32*bd4fcc09Stron SSEEAARRCCHHIINNGG 33*bd4fcc09Stron 34*bd4fcc09Stron /_p_a_t_t_e_r_n * Search forward for (_N-th) matching line. 35*bd4fcc09Stron ?_p_a_t_t_e_r_n * Search backward for (_N-th) matching line. 36*bd4fcc09Stron n * Repeat previous search (for _N-th occurrence). 37*bd4fcc09Stron N * Repeat previous search in reverse direction. 38*bd4fcc09Stron ESC-n * Repeat previous search, spanning files. 39*bd4fcc09Stron ESC-N * Repeat previous search, reverse dir. & spanning files. 40*bd4fcc09Stron ESC-u Undo (toggle) search highlighting. 41*bd4fcc09Stron &_p_a_t_t_e_r_n * Display only matching lines 42*bd4fcc09Stron --------------------------------------------------- 43*bd4fcc09Stron Search patterns may be modified by one or more of: 44*bd4fcc09Stron ^N or ! Search for NON-matching lines. 45*bd4fcc09Stron ^E or * Search multiple files (pass thru END OF FILE). 46*bd4fcc09Stron ^F or @ Start search at FIRST file (for /) or last file (for ?). 47*bd4fcc09Stron ^K Highlight matches, but don't move (KEEP position). 48*bd4fcc09Stron ^R Don't use REGULAR EXPRESSIONS. 49*bd4fcc09Stron --------------------------------------------------------------------------- 50*bd4fcc09Stron 51*bd4fcc09Stron JJUUMMPPIINNGG 52*bd4fcc09Stron 53*bd4fcc09Stron g < ESC-< * Go to first line in file (or line _N). 54*bd4fcc09Stron G > ESC-> * Go to last line in file (or line _N). 55*bd4fcc09Stron p % * Go to beginning of file (or _N percent into file). 56*bd4fcc09Stron t * Go to the (_N-th) next tag. 57*bd4fcc09Stron T * Go to the (_N-th) previous tag. 58*bd4fcc09Stron { ( [ * Find close bracket } ) ]. 59*bd4fcc09Stron } ) ] * Find open bracket { ( [. 60*bd4fcc09Stron ESC-^F _<_c_1_> _<_c_2_> * Find close bracket _<_c_2_>. 61*bd4fcc09Stron ESC-^B _<_c_1_> _<_c_2_> * Find open bracket _<_c_1_> 62*bd4fcc09Stron --------------------------------------------------- 63*bd4fcc09Stron Each "find close bracket" command goes forward to the close bracket 64*bd4fcc09Stron matching the (_N-th) open bracket in the top line. 65*bd4fcc09Stron Each "find open bracket" command goes backward to the open bracket 66*bd4fcc09Stron matching the (_N-th) close bracket in the bottom line. 67*bd4fcc09Stron 68*bd4fcc09Stron m_<_l_e_t_t_e_r_> Mark the current position with <letter>. 69*bd4fcc09Stron '_<_l_e_t_t_e_r_> Go to a previously marked position. 70*bd4fcc09Stron '' Go to the previous position. 71*bd4fcc09Stron ^X^X Same as '. 72*bd4fcc09Stron --------------------------------------------------- 73*bd4fcc09Stron A mark is any upper-case or lower-case letter. 74*bd4fcc09Stron Certain marks are predefined: 75*bd4fcc09Stron ^ means beginning of the file 76*bd4fcc09Stron $ means end of the file 77*bd4fcc09Stron --------------------------------------------------------------------------- 78*bd4fcc09Stron 79*bd4fcc09Stron CCHHAANNGGIINNGG FFIILLEESS 80*bd4fcc09Stron 81*bd4fcc09Stron :e [_f_i_l_e] Examine a new file. 82*bd4fcc09Stron ^X^V Same as :e. 83*bd4fcc09Stron :n * Examine the (_N-th) next file from the command line. 84*bd4fcc09Stron :p * Examine the (_N-th) previous file from the command line. 85*bd4fcc09Stron :x * Examine the first (or _N-th) file from the command line. 86*bd4fcc09Stron :d Delete the current file from the command line list. 87*bd4fcc09Stron = ^G :f Print current file name. 88*bd4fcc09Stron --------------------------------------------------------------------------- 89*bd4fcc09Stron 90*bd4fcc09Stron MMIISSCCEELLLLAANNEEOOUUSS CCOOMMMMAANNDDSS 91*bd4fcc09Stron 92*bd4fcc09Stron -_<_f_l_a_g_> Toggle a command line option [see OPTIONS below]. 93*bd4fcc09Stron --_<_n_a_m_e_> Toggle a command line option, by name. 94*bd4fcc09Stron __<_f_l_a_g_> Display the setting of a command line option. 95*bd4fcc09Stron ___<_n_a_m_e_> Display the setting of an option, by name. 96*bd4fcc09Stron +_c_m_d Execute the less cmd each time a new file is examined. 97*bd4fcc09Stron 98*bd4fcc09Stron !_c_o_m_m_a_n_d Execute the shell command with $SHELL. 99*bd4fcc09Stron |XX_c_o_m_m_a_n_d Pipe file between current pos & mark XX to shell command. 100*bd4fcc09Stron v Edit the current file with $VISUAL or $EDITOR. 101*bd4fcc09Stron V Print version number of "less". 102*bd4fcc09Stron --------------------------------------------------------------------------- 103*bd4fcc09Stron 104*bd4fcc09Stron OOPPTTIIOONNSS 105*bd4fcc09Stron 106*bd4fcc09Stron Most options may be changed either on the command line, 107*bd4fcc09Stron or from within less by using the - or -- command. 108*bd4fcc09Stron Options may be given in one of two forms: either a single 109*bd4fcc09Stron character preceded by a -, or a name preceeded by --. 110*bd4fcc09Stron 111*bd4fcc09Stron -? ........ --help 112*bd4fcc09Stron Display help (from command line). 113*bd4fcc09Stron -a ........ --search-skip-screen 114*bd4fcc09Stron Forward search skips current screen. 115*bd4fcc09Stron -A ........ --SEARCH-SKIP-SCREEN 116*bd4fcc09Stron Forward search always skips target line. 117*bd4fcc09Stron -b [_N] .... --buffers=[_N] 118*bd4fcc09Stron Number of buffers. 119*bd4fcc09Stron -B ........ --auto-buffers 120*bd4fcc09Stron Don't automatically allocate buffers for pipes. 121*bd4fcc09Stron -c ........ --clear-screen 122*bd4fcc09Stron Repaint by clearing rather than scrolling. 123*bd4fcc09Stron -d ........ --dumb 124*bd4fcc09Stron Dumb terminal. 125*bd4fcc09Stron -D [_x_n_._n] . --color=_x_n_._n 126*bd4fcc09Stron Set screen colors. (MS-DOS only) 127*bd4fcc09Stron -e -E .... --quit-at-eof --QUIT-AT-EOF 128*bd4fcc09Stron Quit at end of file. 129*bd4fcc09Stron -f ........ --force 130*bd4fcc09Stron Force open non-regular files. 131*bd4fcc09Stron -F ........ --quit-if-one-screen 132*bd4fcc09Stron Quit if entire file fits on first screen. 133*bd4fcc09Stron -g ........ --hilite-search 134*bd4fcc09Stron Highlight only last match for searches. 135*bd4fcc09Stron -G ........ --HILITE-SEARCH 136*bd4fcc09Stron Don't highlight any matches for searches. 137*bd4fcc09Stron -h [_N] .... --max-back-scroll=[_N] 138*bd4fcc09Stron Backward scroll limit. 139*bd4fcc09Stron -i ........ --ignore-case 140*bd4fcc09Stron Ignore case in searches that do not contain uppercase. 141*bd4fcc09Stron -I ........ --IGNORE-CASE 142*bd4fcc09Stron Ignore case in all searches. 143*bd4fcc09Stron -j [_N] .... --jump-target=[_N] 144*bd4fcc09Stron Screen position of target lines. 145*bd4fcc09Stron -J ........ --status-column 146*bd4fcc09Stron Display a status column at left edge of screen. 147*bd4fcc09Stron -k [_f_i_l_e] . --lesskey-file=[_f_i_l_e] 148*bd4fcc09Stron Use a lesskey file. 149*bd4fcc09Stron -K --quit-on-intr 150*bd4fcc09Stron Exit less in response to ctrl-C. 151*bd4fcc09Stron -L ........ --no-lessopen 152*bd4fcc09Stron Ignore the LESSOPEN environment variable. 153*bd4fcc09Stron -m -M .... --long-prompt --LONG-PROMPT 154*bd4fcc09Stron Set prompt style. 155*bd4fcc09Stron -n -N .... --line-numbers --LINE-NUMBERS 156*bd4fcc09Stron Don't use line numbers. 157*bd4fcc09Stron -o [_f_i_l_e] . --log-file=[_f_i_l_e] 158*bd4fcc09Stron Copy to log file (standard input only). 159*bd4fcc09Stron -O [_f_i_l_e] . --LOG-FILE=[_f_i_l_e] 160*bd4fcc09Stron Copy to log file (unconditionally overwrite). 161*bd4fcc09Stron -p [_p_a_t_t_e_r_n] --pattern=[_p_a_t_t_e_r_n] 162*bd4fcc09Stron Start at pattern (from command line). 163*bd4fcc09Stron -P [_p_r_o_m_p_t] --prompt=[_p_r_o_m_p_t] 164*bd4fcc09Stron Define new prompt. 165*bd4fcc09Stron -q -Q .... --quiet --QUIET --silent --SILENT 166*bd4fcc09Stron Quiet the terminal bell. 167*bd4fcc09Stron -r -R .... --raw-control-chars --RAW-CONTROL-CHARS 168*bd4fcc09Stron Output "raw" control characters. 169*bd4fcc09Stron -s ........ --squeeze-blank-lines 170*bd4fcc09Stron Squeeze multiple blank lines. 171*bd4fcc09Stron -S ........ --chop-long-lines 172*bd4fcc09Stron Chop long lines. 173*bd4fcc09Stron -t [_t_a_g] .. --tag=[_t_a_g] 174*bd4fcc09Stron Find a tag. 175*bd4fcc09Stron -T [_t_a_g_s_f_i_l_e] --tag-file=[_t_a_g_s_f_i_l_e] 176*bd4fcc09Stron Use an alternate tags file. 177*bd4fcc09Stron -u -U .... --underline-special --UNDERLINE-SPECIAL 178*bd4fcc09Stron Change handling of backspaces. 179*bd4fcc09Stron -V ........ --version 180*bd4fcc09Stron Display the version number of "less". 181*bd4fcc09Stron -w ........ --hilite-unread 182*bd4fcc09Stron Highlight first new line after forward-screen. 183*bd4fcc09Stron -W ........ --HILITE-UNREAD 184*bd4fcc09Stron Highlight first new line after any forward movement. 185*bd4fcc09Stron -x [_N[,...]] --tabs=[_N[,...]] 186*bd4fcc09Stron Set tab stops. 187*bd4fcc09Stron -X ........ --no-init 188*bd4fcc09Stron Don't use termcap init/deinit strings. 189*bd4fcc09Stron --no-keypad 190*bd4fcc09Stron Don't use termcap keypad init/deinit strings. 191*bd4fcc09Stron -y [_N] .... --max-forw-scroll=[_N] 192*bd4fcc09Stron Forward scroll limit. 193*bd4fcc09Stron -z [_N] .... --window=[_N] 194*bd4fcc09Stron Set size of window. 195*bd4fcc09Stron -" [_c[_c]] . --quotes=[_c[_c]] 196*bd4fcc09Stron Set shell quote characters. 197*bd4fcc09Stron -~ ........ --tilde 198*bd4fcc09Stron Don't display tildes after end of file. 199*bd4fcc09Stron -# [_N] .... --shift=[_N] 200*bd4fcc09Stron Horizontal scroll amount (0 = one half screen width) 201*bd4fcc09Stron ........ --no-keypad 202*bd4fcc09Stron Don't send keypad init/deinit sequence. 203*bd4fcc09Stron ........ --follow-name 204*bd4fcc09Stron The F command changes files if the input file is renamed. 205*bd4fcc09Stron 206*bd4fcc09Stron 207*bd4fcc09Stron --------------------------------------------------------------------------- 208*bd4fcc09Stron 209*bd4fcc09Stron LLIINNEE EEDDIITTIINNGG 210*bd4fcc09Stron 211*bd4fcc09Stron These keys can be used to edit text being entered 212*bd4fcc09Stron on the "command line" at the bottom of the screen. 213*bd4fcc09Stron 214*bd4fcc09Stron RightArrow ESC-l Move cursor right one character. 215*bd4fcc09Stron LeftArrow ESC-h Move cursor left one character. 216*bd4fcc09Stron CNTL-RightArrow ESC-RightArrow ESC-w Move cursor right one word. 217*bd4fcc09Stron CNTL-LeftArrow ESC-LeftArrow ESC-b Move cursor left one word. 218*bd4fcc09Stron HOME ESC-0 Move cursor to start of line. 219*bd4fcc09Stron END ESC-$ Move cursor to end of line. 220*bd4fcc09Stron BACKSPACE Delete char to left of cursor. 221*bd4fcc09Stron DELETE ESC-x Delete char under cursor. 222*bd4fcc09Stron CNTL-BACKSPACE ESC-BACKSPACE Delete word to left of cursor. 223*bd4fcc09Stron CNTL-DELETE ESC-DELETE ESC-X Delete word under cursor. 224*bd4fcc09Stron CNTL-U ESC (MS-DOS only) Delete entire line. 225*bd4fcc09Stron UpArrow ESC-k Retrieve previous command line. 226*bd4fcc09Stron DownArrow ESC-j Retrieve next command line. 227*bd4fcc09Stron TAB Complete filename & cycle. 228*bd4fcc09Stron SHIFT-TAB ESC-TAB Complete filename & reverse cycle. 229*bd4fcc09Stron CNTL-L Complete filename, list all. 230*bd4fcc09Stron 231*bd4fcc09Stron 232