how to do grep in the man command of linux using xargs?

I want to grep into a manual of a particular command say man grep |grep 'insensitive'. One of friends told me that It can be done using xargs but I cant seem figure out how. I want to do it using xargs only because I am new to it and it is a very powerful tool.

Can anyone help me with this.

4

4 Answers

This will output the manual entry for grep to standard out by using cat as the pager:

man -P cat grep | grep -i insensitive

[BTW: The word "insensitive" does not appear in the manual for grep. Try ignore-case.]

You could always google like this:

site:// keyword
3

Try this:

man grep | col -b | grep 'insensitive'

You may have to install col first. But you can "search" within less using / as was pointed out in the comments.

$ bzcat $(man -W bash |tail -n1) |man2html | \ html2text -style pretty -nobs | grep HISTORY
When the command history expansion facilities are being used (see HISTORY The name of the file in which command history is saved (see HISTORY The number of commands to remember in the command history (see HISTORY tokenization (see HISTORY EXPANSION below). The first character is the
commands restored from the history file (see HISTORY below), while the command
HISTORY below) for lines containing a specified string. There are two search expansion as well as all of the shell word expansions. See HISTORY Perform history expansion on the current line. See HISTORY EXPANSION HISTORY EXPANSION below for a description of history expansion.
HISTORY
HISTORY EXPANSION HISTORY. This option is on by default in HISTORY HISTORY_EXPANSION

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like