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