This open-man-page-and-search-for-string-in-a-single-command question half covers what I'm trying to do:
Instead of doing man chmod and then /a+x to jump to the first section in the chmod man page that mentions a+x, I would like to know if there is a way to open the man page to a specific search string, similar to how you can do vi +string filename.txt in vi(m).
The chosen answer was
man foobar | less +/searched_string
However, when I try
man tmux | less +/^format
Less launches but returns
Pattern not found (press RETURN)
Why is the pattern not being found?
OS - Ubuntu 15.10
% less --version
less 458 (GNU regular expressions)
Copyright (C) 1984-2012 Mark Nudelman
less '+/^\s*format'
– Gilles 'SO- stop being evil' Apr 19 '16 at 22:27man tmux | less +/^\s*format
doesnt work as intended. What I didnt realise is that the - search as an argument - method is case sensitive. So yes it is a duplicate, I didnt realise I was doing it wrong till after I asked - and answered the question! – the_velour_fog Apr 19 '16 at 22:36less
does case-sensitive search by default. But some versions ofman
invokeless -i
to make search case-insensitive. – Gilles 'SO- stop being evil' Apr 19 '16 at 22:38