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