0

I would like to grep a chunk of data from example: man find.

I know there is a section of examples in man find, it starts with EXAMPLES and end with EXIT STATUS. Hence i want to grep that specific chunk of data out.

How to do that with simplest way ? best without using other tools which i might not know how to use yet.

$man find | grep '\<EXAMPLES .... ' ?

I find RegEx is very hard to remember and apply.. Anybody has got any trick to it ? thx

andrew_ysk
  • 119
  • 5
  • Please add sample input (no descriptions, no images, no links) and your desired output for that sample input to your question (no comment). – Cyrus Jan 05 '21 at 10:43
  • Your best bet is using `sed`, `awk` or `perl` for this rather than `grep` -- any of [these](https://stackoverflow.com/questions/38972736/how-to-print-lines-between-two-patterns-inclusive-or-exclusive-in-sed-awk-or) solutions will do. If you really want to use `grep`, then [this](https://stackoverflow.com/a/38975890/14722562) answer does just that -- but it requires PCRE anyway. – costaparas Jan 05 '21 at 10:45
  • @andrew did the above solve your problem? I feel this question is a duplicate of finding lines between two patterns, and as such should be closed as a duplicate. – costaparas Jan 07 '21 at 09:24
  • 1
    Yes, that answered my question. Thank You costaparas! – andrew_ysk Jan 07 '21 at 21:18

0 Answers0