Building on orion's answer, the
less(1) man page describes
Search forward in the file for the N-th line
N † defaults to 1.
pattern is a regular expression,
as recognized by the regular expression library supplied by your system.
The search starts at the second line displayed
(but see the
-j options, which change this).
Certain characters are special
if entered at the beginning of the
they modify the type of search
rather than become part of the
Search for lines which do NOT match the
Search multiple files.
That is, if the search reaches the END of the current file
without finding a match,
the search continues in the next file in the command line list.
Begin the search
at the first line of the FIRST file in the command line list,
regardless of what is currently displayed on the screen
or the settings of the
Highlight any text
which matches the
pattern on the current screen,
but don't move to the first match (KEEP current position).
Don't interpret regular expression metacharacters;
that is, do a simple textual comparison.
† Commands may be preceded by a decimal number,
called N in the descriptions …
^E, etc., represent
Ctrl+N and Ctrl+E, etc.)
It turns out that
/pattern work well together.
For example, the commands
typed in either order, will hide (exclude) all lines
grep -v), and then, in the remaining lines,
highlight all occurrences of
or anything that looks like the name of a SCSI device (
Note that lines that contain
fail or any of the other danger words,
will not be displayed.