I run
man gcc | grep "-L"
I get
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
How can you grep the match?
I run
man gcc | grep "-L"
I get
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
How can you grep the match?
man gcc | grep -- "-L"
Notice the argument "--" which means "don't treat anything that follows as an option".
Also, if you took the advice in the error message to run "grep --help" it would have shown you can also explicitly set the pattern with the -e / --regexp option.
man gcc | grep -e "-L"
man gcc | grep --regexp="-L"
As others have said, grep ( and many other gnu commands ) has a "--" option to tell grep that the remainder of the arguments are not to be treated as options to grep.
However, this will only get you lines that have "-L" on them, and that may not give you context. Are you aware that man has a built-in search capability?
man gcc
/-L
Then keep hitting 'n' to see the next match.