If I do man bash | grep read -c
the output is 218
. But I want to search only for colored regex in man. I still haven't find an approach. Any hint is welcome.
Asked
Active
Viewed 202 times
0

Jeff Schaller
- 67,283
- 35
- 116
- 255

John Goofy
- 931
1 Answers
0
With the man
implementation from man-db
MAN_KEEP_FORMATTING=1 man bash | grep -c $'r\bre\bea\bad\bd'
See
- Grep: unexpected results when searching for words in heading from man page for the background and
- How can I search for bolded or underlined text? for more options.

Stéphane Chazelas
- 544,893
less
, this one forgrep
, so while some of the answers there apply here, not all do, and some man implementations stop outputting in colour when piped and there way be different approaches that one could use forgrep
– Stéphane Chazelas Oct 30 '18 at 15:47