It depends what pager you use.
If using the
less pager, search strings (as when you type
?) are actually extended regular expressions (with
As a regular expression,
-s$ would match on a
-S as searches ignore case by default in
less when called by
man unless the search pattern contains an uppercase letter, type
-i for case sensitive) that is at the end of the line.
-s[[:space:]]*$ would match on
-s, followed by 0 or more spacing characters followed by the end of the line.
most pager, searches are just plain string that are found in the contents of lines, so you're left without an option there.
You can specify which pager
man will use to display the formatted man page with the
$PAGER environment variable. With the implementation from
man-db, you can also specify it with the
-P option which takes precedence over the
$MANPAGER environment variable which itself takes precedence over the
Which pager is used by default depends on the system and
man implementation. On my system (Debian),
man-db) invokes the
pager command (which is managed as a dpkg alternative and by default is
less), but has some
less-specific configurations (it sets a number of
LESS* environment variables).
You could also do
man some-topic | less to pipe the formatted output to
less by yourself, or:
man some-topic | less '+/-s$' for
less to start searching for that pattern upon start, but beware that with the man-db implementation of
man, redirecting the output disables the formatting.
Instead you can give
less its list of options with the
$LESS environment variable, but note that
$ has a special meaning there, and would need to be escaped:
LESS='--use-backslash +/-s\$' man -P less some-topic