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