less Flashcards
less
less is a filter for paging through text one screenful at a time.
less [MOVING]
e
y
f
b
e, Forward one line.
y, Backward one line.
f, Forward one window.
b, Backward one window.
less [SEARCHING]
/pattern
?pattern
n
N
/pattern, Search forward for matching lines.
?pattern, Search backward for matching lines.
n, Repeat previous search for another occurance.
N, Repeat previous search in the reverse direction.
less [JUMPING]
g
G
p
t
T
g, Goto first line in a file.
G, Goto last line in a file.
p, Goto beginning of file(or N percent into file)
t, Goto the next tag.
T, Goto the previous tag.
less [CHANGING FILES]
:e [file]
:n
:p
:x
:d
=
:e [file], Examine a new file.
:n, Examine the next file from the command line.
:p, Examine the previous file from the command line.
:x, Examine the first file from the command line list.
:d, Delete the current file from the command line list.
=, Print current file name.
less [MISCELLANEOUS COMMANDS]
v
v, Edit the current file with $VISUAL or $EDITOR
less [OPTIONS]
- ?
- a
- A
- b
- B
- c
- ?, –help, Display help.
- a, –search-skip-screen, Search skips current screen.
- A, –SEARCH-SKIP-SCREEN, Search starts just after target line.
- b [N], –buffers=[N], Number of buffers.
- B, –auto-buffers, Don’t automatically allocate buffers for pipes.
- c, –clear-screen, Repaint by clearing rather than scrolling.
less [OPTIONS]
- d
- D [xn.n]
- e, -E
- f
- F
- d, –dumb, Dumb terminal.
- D [xn.n], –color=xn.n, Set screen colors. (MS-DOS only).
- e, -E, –quit-at-eof, –QUIT-AT-EOF, Quit at end of file.
- f, –force, Force open non-regular files.
- F, –quit-if-one-screen, Quit if entire file fits on first screen.
less [OPTIONS]
- g
- G
- h [N]
- i
- I
- j [N]
- g, –hilite-search, Highlight only last match for searches.
- G, –HILITE-SEARCH, Don’t highlight any matches for searches.
- h [N], –max-back-scroll=[N], Backward scroll limit.
- i, –ignore-case, Ignore case in searches that do not contain uppercase.
- I, –IGNORE-CASE, Ignore case in all searches.
- j [N], –jump-target=[N], Screen position of target lines.
less [OPTIONS]
- J
- k [file]
- K
- L
- m, -M
- n, -N
- J, –status-column, Display a status column at left edge of screen.
- k [file], –lesskey-file=[file], Use a lesskey file.
- K, –quit-on-intr, Exit less in reponse to crtl-C.
- L, –no-lessopen, Ignore the LESSOPEN environment variable.
- m, -M, –long-prompt, –LONG-PROMPT, Set prompt style.
- n, -N, –line-numbers, –LINE-NUMBERS, Don’t use line numbers.
less [OPTIONS]
- o [file]
- O [file]
- p [pattern]
- P [prompt]
- q, -Q
- r, -R
- o [file], –log-file=[file], Copy to log file (stdin only)
- O [file], –LOG-FILE=[file], Copy to log file (unconditionally overwrite).
- p [pattern], –pattern=[pattern], Start at pattern (from command line).
- P [prompt], –prompt=[prompt], Define new prompt.
- q, -Q, –quiet, –QUIET, –silent, –SILENT, Quiet the terminal bell.
- r, -R, –raw-control-chars, –RAW-CONTROL-CHARS, Output “raw” control characters.
less [OPTIONS]
- s
- S
- t [tag]
- T [tagsfile]
- u, -U
- V
- s, –squeeze-blank-lines, Squeeze multiple blank lines.
- S, –chop-long-lines, Chop (truncate) long lines rather than wrapping.
- t [tag], –tag=[tag], Find a tag.
- T [tagsfile], –tag-file=[tagsfile], Use an alternate tags file.
- u, -U, –underline-special, –UNDERLINE-SPECIAL, Change handling of backspaces.
- V, –version, Display version number.
less [OPTIONS]
- w
- W
- x [N[…]]
- X
- y [N]
- z [N]
- w, –hilite-unread, Highlight first new line after forward screen.
- W, –HILITE-UNREAD, Highlight first new line after any forward movement.
- x [N[…]], –tabs=[N[…]], Set tab stops.
- X, –no-init, Don’t use termcap init/deinit strings.
- y [N], –max-forw-scroll=[N], Forward scroll limit.
- z [N], –window=[N], Set size of window.
less {OPTIONS]
- ” [c[c]]
- ~
- # [N]
–no-keypad
–follow-name
–use-backslash
- ” [c[c]], –quotes=[c[c]], Set shell quote characters.
- ~, –tilde, Don’t display tildes after end of file.
- # [N], –shift=[N], Horizontal scroll amount (0 = one half screen width)
–no-keypad, Don’t send termcap keypad init/deinit strings.
–follow-name, The F command changes files if the input file is renamed.
–use-backslash, Subsequent options use backslash as escape char.