I frequently refer to man bash to recall use of "history expansion" parts(events/words/modifiers). I know that the man part I need is
"HISTORY EXPANSION". So I type in HISTORY EXPANSION
in forward search list '/'. Of course less jumps not straightforward to the "HISTORY EXPANSION" part, but instead shows all occurrences of this string in given man. Thus, I thought it would be great to type something like:
/^HISTORY EXPANSION
so I could jump to "start of line"HISTORY EXPANSION.
Neither /^HISTORY EXPANSION
nor /\^HISTORY EXPANSION
work
In less man I see that ...
/pattern
Search forward in the file for the N-th line containing the pattern. N defaults to 1. The pattern is a regular expression, as recognized by the regular expression library supplied by your system.
I see that other men were also looking into this, but with a different purpose: https://stackoverflow.com/questions/14698364/what-is-the-regular-expression-library-supplied-by-my-system
I followed the steps, but still cannot say for sure what regex version is used on my machine. Here is the shared lib dependencies output for less binary
$ ldd /usr/bin/less
linux-vdso.so.1 => (0x00007ffc229cb000)
libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007f44968e9000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f4496524000)
/lib64/ld-linux-x86-64.so.2 (0x00007f4496b12000)
So, how to indicate start of line in less search, so I can easily jump to the parts of man I need?
/^HISTORY EX
followed by return works for me in the manual ofbash
on a Linux system. I can't reproduce your issue.info
with which you have a searchable index (i
, then typehistory expansion
with tab completion)man
asGROFF_SGR=1 MANPAGER='less -r' man bash
. You'd want to make sureless
is run with-R
instead of-r
(for it do understand those SGR escape sequences as opposed to pass them through), or useGROFF_NO_SGR
to revert to the traditional way of doing bold/underline.