1 2 SSUUMMMMAARRYY OOFF LLEESSSS CCOOMMMMAANNDDSS 3 4 Commands marked with * may be preceded by a number, _N. 5 Notes in parentheses indicate the behavior if _N is given. 6 A key preceded by a caret indicates the Ctrl key; thus ^K is ctrl-K. 7 8 h H Display this help. 9 q :q Q :Q ZZ Exit. 10 --------------------------------------------------------------------------- 11 12 MMOOVVIINNGG 13 14 e ^E j ^N CR * Forward one line (or _N lines). 15 y ^Y k ^K ^P * Backward one line (or _N lines). 16 ESC-j * Forward one file line (or _N file lines). 17 ESC-k * Backward one file line (or _N file lines). 18 f ^F ^V SPACE * Forward one window (or _N lines). 19 b ^B ESC-v * Backward one window (or _N lines). 20 z * Forward one window (and set window to _N). 21 w * Backward one window (and set window to _N). 22 ESC-SPACE * Forward one window, but don't stop at end-of-file. 23 ESC-b * Backward one window, but don't stop at beginning-of-file. 24 d ^D * Forward one half-window (and set half-window to _N). 25 u ^U * Backward one half-window (and set half-window to _N). 26 ESC-) RightArrow * Right one half screen width (or _N positions). 27 ESC-( LeftArrow * Left one half screen width (or _N positions). 28 ESC-} ^RightArrow Right to last column displayed. 29 ESC-{ ^LeftArrow Left to first column. 30 F Forward forever; like "tail -f". 31 ESC-F Like F but stop when search pattern is found. 32 ESC-f Like F but ring the bell when search pattern is found. 33 r ^R ^L Repaint screen. 34 R Repaint screen, discarding buffered input. 35 --------------------------------------------------- 36 Default "window" is the screen height. 37 Default "half-window" is half of the screen height. 38 --------------------------------------------------------------------------- 39 40 SSEEAARRCCHHIINNGG 41 42 /_p_a_t_t_e_r_n * Search forward for (_N-th) matching line. 43 ?_p_a_t_t_e_r_n * Search backward for (_N-th) matching line. 44 n * Repeat previous search (for _N-th occurrence). 45 N * Repeat previous search in reverse direction. 46 ESC-n * Repeat previous search, spanning files. 47 ESC-N * Repeat previous search, reverse dir. & spanning files. 48 ^O^N ^On * Search forward for (_N-th) OSC8 hyperlink. 49 ^O^P ^Op * Search backward for (_N-th) OSC8 hyperlink. 50 ^O^L ^Ol Jump to the currently selected OSC8 hyperlink. 51 ESC-u Undo (toggle) search highlighting. 52 ESC-U Clear search highlighting. 53 &_p_a_t_t_e_r_n * Display only matching lines. 54 --------------------------------------------------- 55 Search is case-sensitive unless changed with -i or -I. 56 A search pattern may begin with one or more of: 57 ^N or ! Search for NON-matching lines. 58 ^E or * Search multiple files (pass thru END OF FILE). 59 ^F or @ Start search at FIRST file (for /) or last file (for ?). 60 ^K Highlight matches, but don't move (KEEP position). 61 ^R Don't use REGULAR EXPRESSIONS. 62 ^S _n Search for match in _n-th parenthesized subpattern. 63 ^W WRAP search if no match found. 64 ^L Enter next character literally into pattern. 65 --------------------------------------------------------------------------- 66 67 JJUUMMPPIINNGG 68 69 g < ESC-< HOME * Go to first line in file (or line _N). 70 G > ESC-> END * Go to last line in file (or line _N). 71 p % * Go to beginning of file (or _N percent into file). 72 t * Go to the (_N-th) next tag. 73 T * Go to the (_N-th) previous tag. 74 { ( [ * Find close bracket } ) ]. 75 } ) ] * Find open bracket { ( [. 76 ESC-^F _<_c_1_> _<_c_2_> * Find close bracket _<_c_2_>. 77 ESC-^B _<_c_1_> _<_c_2_> * Find open bracket _<_c_1_>. 78 --------------------------------------------------- 79 Each "find close bracket" command goes forward to the close bracket 80 matching the (_N-th) open bracket in the top line. 81 Each "find open bracket" command goes backward to the open bracket 82 matching the (_N-th) close bracket in the bottom line. 83 84 m_<_l_e_t_t_e_r_> Mark the current top line with <letter>. 85 M_<_l_e_t_t_e_r_> Mark the current bottom line with <letter>. 86 '_<_l_e_t_t_e_r_> Go to a previously marked position. 87 '' Go to the previous position. 88 ^X^X Same as '. 89 ESC-m_<_l_e_t_t_e_r_> Clear a mark. 90 --------------------------------------------------- 91 A mark is any upper-case or lower-case letter. 92 Certain marks are predefined: 93 ^ means beginning of the file 94 $ means end of the file 95 --------------------------------------------------------------------------- 96 97 CCHHAANNGGIINNGG FFIILLEESS 98 99 :e [_f_i_l_e] Examine a new file. 100 ^X^V Same as :e. 101 :n * Examine the (_N-th) next file from the command line. 102 :p * Examine the (_N-th) previous file from the command line. 103 :x * Examine the first (or _N-th) file from the command line. 104 ^O^O Open the currently selected OSC8 hyperlink. 105 :d Delete the current file from the command line list. 106 = ^G :f Print current file name. 107 --------------------------------------------------------------------------- 108 109 MMIISSCCEELLLLAANNEEOOUUSS CCOOMMMMAANNDDSS 110 111 -_<_f_l_a_g_> Toggle a command line option [see OPTIONS below]. 112 --_<_n_a_m_e_> Toggle a command line option, by name. 113 __<_f_l_a_g_> Display the setting of a command line option. 114 ___<_n_a_m_e_> Display the setting of an option, by name. 115 +_c_m_d Execute the less cmd each time a new file is examined. 116 117 !_c_o_m_m_a_n_d Execute the shell command with $SHELL. 118 #_c_o_m_m_a_n_d Execute the shell command, expanded like a prompt. 119 |XX_c_o_m_m_a_n_d Pipe file between current pos & mark XX to shell command. 120 s _f_i_l_e Save input to a file. 121 v Edit the current file with $VISUAL or $EDITOR. 122 V Print version number of "less". 123 --------------------------------------------------------------------------- 124 125 OOPPTTIIOONNSS 126 127 Most options may be changed either on the command line, 128 or from within less by using the - or -- command. 129 Options may be given in one of two forms: either a single 130 character preceded by a -, or a name preceded by --. 131 132 -? ........ --help 133 Display help (from command line). 134 -a ........ --search-skip-screen 135 Search skips current screen. 136 -A ........ --SEARCH-SKIP-SCREEN 137 Search starts just after target line. 138 -b [_N] .... --buffers=[_N] 139 Number of buffers. 140 -B ........ --auto-buffers 141 Don't automatically allocate buffers for pipes. 142 -c ........ --clear-screen 143 Repaint by clearing rather than scrolling. 144 -d ........ --dumb 145 Dumb terminal. 146 -D xx_c_o_l_o_r . --color=xx_c_o_l_o_r 147 Set screen colors. 148 -e -E .... --quit-at-eof --QUIT-AT-EOF 149 Quit at end of file. 150 -f ........ --force 151 Force open non-regular files. 152 -F ........ --quit-if-one-screen 153 Quit if entire file fits on first screen. 154 -g ........ --hilite-search 155 Highlight only last match for searches. 156 -G ........ --HILITE-SEARCH 157 Don't highlight any matches for searches. 158 -h [_N] .... --max-back-scroll=[_N] 159 Backward scroll limit. 160 -i ........ --ignore-case 161 Ignore case in searches that do not contain uppercase. 162 -I ........ --IGNORE-CASE 163 Ignore case in all searches. 164 -j [_N] .... --jump-target=[_N] 165 Screen position of target lines. 166 -J ........ --status-column 167 Display a status column at left edge of screen. 168 -k _f_i_l_e ... --lesskey-file=_f_i_l_e 169 Use a compiled lesskey file. 170 -K ........ --quit-on-intr 171 Exit less in response to ctrl-C. 172 -L ........ --no-lessopen 173 Ignore the LESSOPEN environment variable. 174 -m -M .... --long-prompt --LONG-PROMPT 175 Set prompt style. 176 -n ......... --line-numbers 177 Suppress line numbers in prompts and messages. 178 -N ......... --LINE-NUMBERS 179 Display line number at start of each line. 180 -o [_f_i_l_e] .. --log-file=[_f_i_l_e] 181 Copy to log file (standard input only). 182 -O [_f_i_l_e] .. --LOG-FILE=[_f_i_l_e] 183 Copy to log file (unconditionally overwrite). 184 -p _p_a_t_t_e_r_n . --pattern=[_p_a_t_t_e_r_n] 185 Start at pattern (from command line). 186 -P [_p_r_o_m_p_t] --prompt=[_p_r_o_m_p_t] 187 Define new prompt. 188 -q -Q .... --quiet --QUIET --silent --SILENT 189 Quiet the terminal bell. 190 -r -R .... --raw-control-chars --RAW-CONTROL-CHARS 191 Output "raw" control characters. 192 -s ........ --squeeze-blank-lines 193 Squeeze multiple blank lines. 194 -S ........ --chop-long-lines 195 Chop (truncate) long lines rather than wrapping. 196 -t _t_a_g .... --tag=[_t_a_g] 197 Find a tag. 198 -T [_t_a_g_s_f_i_l_e] --tag-file=[_t_a_g_s_f_i_l_e] 199 Use an alternate tags file. 200 -u -U .... --underline-special --UNDERLINE-SPECIAL 201 Change handling of backspaces, tabs and carriage returns. 202 -V ........ --version 203 Display the version number of "less". 204 -w ........ --hilite-unread 205 Highlight first new line after forward-screen. 206 -W ........ --HILITE-UNREAD 207 Highlight first new line after any forward movement. 208 -x [_N[,...]] --tabs=[_N[,...]] 209 Set tab stops. 210 -X ........ --no-init 211 Don't use termcap init/deinit strings. 212 -y [_N] .... --max-forw-scroll=[_N] 213 Forward scroll limit. 214 -z [_N] .... --window=[_N] 215 Set size of window. 216 -" [_c[_c]] . --quotes=[_c[_c]] 217 Set shell quote characters. 218 -~ ........ --tilde 219 Don't display tildes after end of file. 220 -# [_N] .... --shift=[_N] 221 Set horizontal scroll amount (0 = one half screen width). 222 223 --autosave=[_m_/_!_*] 224 Actions which cause the history file to be saved. 225 --exit-follow-on-close 226 Exit F command on a pipe when writer closes pipe. 227 --file-size 228 Automatically determine the size of the input file. 229 --follow-name 230 The F command changes files if the input file is renamed. 231 --form-feed 232 Stop scrolling when a form feed character is reached. 233 --header=[_L[,_C[,_N]]] 234 Use _L lines (starting at line _N) and _C columns as headers. 235 --incsearch 236 Search file as each pattern character is typed in. 237 --intr=[_C] 238 Use _C instead of ^X to interrupt a read. 239 --lesskey-context=_t_e_x_t 240 Use lesskey source file contents. 241 --lesskey-src=_f_i_l_e 242 Use a lesskey source file. 243 --line-num-width=[_N] 244 Set the width of the -N line number field to _N characters. 245 --match-shift=[_N] 246 Show at least _N characters to the left of a search match. 247 --modelines=[_N] 248 Read _N lines from the input file and look for vim modelines. 249 --mouse 250 Enable mouse input. 251 --no-edit-warn 252 Don't warn when using v command on a file opened via LESSOPEN. 253 --no-keypad 254 Don't send termcap keypad init/deinit strings. 255 --no-histdups 256 Remove duplicates from command history. 257 --no-number-headers 258 Don't give line numbers to header lines. 259 --no-paste 260 Ignore pasted input. 261 --no-search-header-lines 262 Searches do not include header lines. 263 --no-search-header-columns 264 Searches do not include header columns. 265 --no-search-headers 266 Searches do not include header lines or columns. 267 --no-vbell 268 Disable the terminal's visual bell. 269 --redraw-on-quit 270 Redraw final screen when quitting. 271 --rscroll=[_C] 272 Set the character used to mark truncated lines. 273 --save-marks 274 Retain marks across invocations of less. 275 --search-options=[EFKNRW-] 276 Set default options for every search. 277 --show-preproc-errors 278 Display a message if preprocessor exits with an error status. 279 --proc-backspace 280 Process backspaces for bold/underline. 281 --PROC-BACKSPACE 282 Treat backspaces as control characters. 283 --proc-return 284 Delete carriage returns before newline. 285 --PROC-RETURN 286 Treat carriage returns as control characters. 287 --proc-tab 288 Expand tabs to spaces. 289 --PROC-TAB 290 Treat tabs as control characters. 291 --status-col-width=[_N] 292 Set the width of the -J status column to _N characters. 293 --status-line 294 Highlight or color the entire line containing a mark. 295 --use-backslash 296 Subsequent options use backslash as escape char. 297 --use-color 298 Enables colored text. 299 --wheel-lines=[_N] 300 Each click of the mouse wheel moves _N lines. 301 --wordwrap 302 Wrap lines at spaces. 303 304 305 --------------------------------------------------------------------------- 306 307 LLIINNEE EEDDIITTIINNGG 308 309 These keys can be used to edit text being entered 310 on the "command line" at the bottom of the screen. 311 312 RightArrow ..................... ESC-l ... Move cursor right one character. 313 LeftArrow ...................... ESC-h ... Move cursor left one character. 314 ctrl-RightArrow ESC-RightArrow ESC-w ... Move cursor right one word. 315 ctrl-LeftArrow ESC-LeftArrow ESC-b ... Move cursor left one word. 316 HOME ........................... ESC-0 ... Move cursor to start of line. 317 END ............................ ESC-$ ... Move cursor to end of line. 318 BACKSPACE ................................ Delete char to left of cursor. 319 DELETE ......................... ESC-x ... Delete char under cursor. 320 ctrl-BACKSPACE ESC-BACKSPACE ........... Delete word to left of cursor. 321 ctrl-DELETE .... ESC-DELETE .... ESC-X ... Delete word under cursor. 322 ctrl-U ......... ESC (MS-DOS only) ....... Delete entire line. 323 UpArrow ........................ ESC-k ... Retrieve previous command line. 324 DownArrow ...................... ESC-j ... Retrieve next command line. 325 TAB ...................................... Complete filename & cycle. 326 SHIFT-TAB ...................... ESC-TAB Complete filename & reverse cycle. 327 ctrl-L ................................... Complete filename, list all. 328