Is there way to see `man` document only for specified option of a command

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
22
down vote

favorite
8












If I want to know the meaning of wget -b, I see the manual by man wget, then search the -b option.



 -b
--background
Go to background immediately after startup. If no output file is specified via the -o, output is redirected to wget-log.


I want to get the result by a command like man wget -b. (Of course this doesn't work.)



Is there a similar way to make it possible?







share|improve this question






















  • wget -h | grep '-b'
    – Faheem Mitha
    Jan 23 '15 at 14:29














up vote
22
down vote

favorite
8












If I want to know the meaning of wget -b, I see the manual by man wget, then search the -b option.



 -b
--background
Go to background immediately after startup. If no output file is specified via the -o, output is redirected to wget-log.


I want to get the result by a command like man wget -b. (Of course this doesn't work.)



Is there a similar way to make it possible?







share|improve this question






















  • wget -h | grep '-b'
    – Faheem Mitha
    Jan 23 '15 at 14:29












up vote
22
down vote

favorite
8









up vote
22
down vote

favorite
8






8





If I want to know the meaning of wget -b, I see the manual by man wget, then search the -b option.



 -b
--background
Go to background immediately after startup. If no output file is specified via the -o, output is redirected to wget-log.


I want to get the result by a command like man wget -b. (Of course this doesn't work.)



Is there a similar way to make it possible?







share|improve this question














If I want to know the meaning of wget -b, I see the manual by man wget, then search the -b option.



 -b
--background
Go to background immediately after startup. If no output file is specified via the -o, output is redirected to wget-log.


I want to get the result by a command like man wget -b. (Of course this doesn't work.)



Is there a similar way to make it possible?









share|improve this question













share|improve this question




share|improve this question








edited Jan 24 '15 at 23:18









Gilles

506k11910021529




506k11910021529










asked Jan 23 '15 at 13:57









ironsand

1,46552243




1,46552243











  • wget -h | grep '-b'
    – Faheem Mitha
    Jan 23 '15 at 14:29
















  • wget -h | grep '-b'
    – Faheem Mitha
    Jan 23 '15 at 14:29















wget -h | grep '-b'
– Faheem Mitha
Jan 23 '15 at 14:29




wget -h | grep '-b'
– Faheem Mitha
Jan 23 '15 at 14:29










6 Answers
6






active

oldest

votes

















up vote
5
down vote



accepted










You could redirect the manpage to awk and extact the part:



man wget | awk '/^ *-b *.*$/,/^$/print'
-b
--background
Go to background immediately after startup. If no output file is specified via the -o, output is redirected to wget-log.


That part is everything that is between a -b and an empty line.






share|improve this answer


















  • 1




    print can be omitted
    – Costas
    Jan 23 '15 at 14:45










  • Thanks, I tried to use with GNU Awk 4.0.1(Ubuntu), GNU Awk 3.1.7(CentOS) and awk version 20070501(OS X), but works only with 4.0.1.
    – ironsand
    Jan 23 '15 at 19:10






  • 1




    .*$ can be omitted too
    – Walter Tross
    Jan 29 '15 at 22:13


















up vote
21
down vote













If you use less as pager for man you can try



LESS="+/^s+-b" man wget


where




  1. + symbol to execute next operation after less has opened


  2. / command to start search


  3. ^s+-b regexp to match -b from start of line

So if you like you can arrange the apropriate function for shell



function rman 
#USAGE: rman programm.name option.to.search (with "-" symbol)
LESS="+/^s+$2" man "$1"



and add it into ~/.bashrc for example.






share|improve this answer






















  • This doesn't work for me, I think because it will not do multiline matching
    – rb612
    Jun 17 at 7:30

















up vote
12
down vote













When you run man command you can press / and then enter the plain text to search for. For example, type /-b and it'll jump to the first instance of -b in the text.






share|improve this answer
















  • 4




    And then n goes to the next instance.
    – drewbenn
    Jan 24 '15 at 6:13










  • @drewbenn Oh, nice. I've always just pressed /+enter to continue on.
    – fluffy
    Jan 25 '15 at 20:27

















up vote
9
down vote













I wrote a small script to do this called he, e.g. he wget -b.



The basic strategy is: search for the option (e.g. -b) as the first word on a line, then print until the next header, or next line with matching indentation.



If you can't use that, you can get something similar using basic sed, e.g.



man wget | sed -ne '/^ *-b/,/^$/p'





share|improve this answer






















  • Also your desc script is very helpful.
    – Pandya
    Oct 4 '14 at 7:07










  • Just decided to rename it to he, as in short help, plus he/man.
    – Mikel
    Oct 4 '14 at 7:19










  • Updated to work with the new example, wget -b.
    – Mikel
    Jan 26 '15 at 7:59

















up vote
3
down vote













I use the following script that connects to explainshell.com. I copied it from reddit some time ago:



#!/bin/bash
cmd=$1
shift
args=$*
args=$args/ /+
w3m -dump "http://explainshell.com/explain/$cmd?args=$args"


I named it rman and put it in my $PATH. Usage for wget -b:



$ rman wget -b 
[logo]

• about
•
• [ ]

wget(1) -b

The non-interactive network downloader

-b
--background
Go to background immediately after startup. If no output file is specified via the -o, output is
redirected to wget-log.

source manpages: wget


You can tweak this script a little to not to show garbage at the beginning.



EDIT: I got it from here. Thanks to the author!






share|improve this answer


















  • 3




    It's important to note that this potentially documents a different implementation/version of the commands from those installed on the machine.
    – Stéphane Chazelas
    Jan 23 '15 at 14:11











  • Also, there's no escaping and bad quoting in the code.
    – l0b0
    Jan 23 '15 at 14:16










  • Yes, I wondered if I should emphasize that. However, if a particular option means something in one flavor of the program it usually means the same in another flavor. What is more often is that some options are missing. Again, this is just my experience.
    – Arkadiusz Drabczyk
    Jan 23 '15 at 14:16










  • @l0b0: I didn't write this code, I wouldn't use bash in the first place
    – Arkadiusz Drabczyk
    Jan 23 '15 at 14:17

















up vote
0
down vote













Alternatively, if your grep is the GNU grep, you can use it as follows:



man wget | grep -EA3 '^ *-b'


In which -A (a GNU extension) is for print number of lines after matching lines (here 3). you can use appropriate number for complete description.



Example:



$ man wget | grep -EA3 '^ *-b'
-b
--background
Go to background immediately after startup. If no output file is specified via the -o, output is
redirected to wget-log.

$ man grep | grep -EA3 '^ *-A'
-A NUM, --after-context=NUM
Print NUM lines of trailing context after matching lines. Places a line containing a group separator
(--) between contiguous groups of matches. With the -o or --only-matching option, this has no effect
and a warning is given.





share|improve this answer






















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );








     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f180639%2fis-there-way-to-see-man-document-only-for-specified-option-of-a-command%23new-answer', 'question_page');

    );

    Post as a guest






























    6 Answers
    6






    active

    oldest

    votes








    6 Answers
    6






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    5
    down vote



    accepted










    You could redirect the manpage to awk and extact the part:



    man wget | awk '/^ *-b *.*$/,/^$/print'
    -b
    --background
    Go to background immediately after startup. If no output file is specified via the -o, output is redirected to wget-log.


    That part is everything that is between a -b and an empty line.






    share|improve this answer


















    • 1




      print can be omitted
      – Costas
      Jan 23 '15 at 14:45










    • Thanks, I tried to use with GNU Awk 4.0.1(Ubuntu), GNU Awk 3.1.7(CentOS) and awk version 20070501(OS X), but works only with 4.0.1.
      – ironsand
      Jan 23 '15 at 19:10






    • 1




      .*$ can be omitted too
      – Walter Tross
      Jan 29 '15 at 22:13















    up vote
    5
    down vote



    accepted










    You could redirect the manpage to awk and extact the part:



    man wget | awk '/^ *-b *.*$/,/^$/print'
    -b
    --background
    Go to background immediately after startup. If no output file is specified via the -o, output is redirected to wget-log.


    That part is everything that is between a -b and an empty line.






    share|improve this answer


















    • 1




      print can be omitted
      – Costas
      Jan 23 '15 at 14:45










    • Thanks, I tried to use with GNU Awk 4.0.1(Ubuntu), GNU Awk 3.1.7(CentOS) and awk version 20070501(OS X), but works only with 4.0.1.
      – ironsand
      Jan 23 '15 at 19:10






    • 1




      .*$ can be omitted too
      – Walter Tross
      Jan 29 '15 at 22:13













    up vote
    5
    down vote



    accepted







    up vote
    5
    down vote



    accepted






    You could redirect the manpage to awk and extact the part:



    man wget | awk '/^ *-b *.*$/,/^$/print'
    -b
    --background
    Go to background immediately after startup. If no output file is specified via the -o, output is redirected to wget-log.


    That part is everything that is between a -b and an empty line.






    share|improve this answer














    You could redirect the manpage to awk and extact the part:



    man wget | awk '/^ *-b *.*$/,/^$/print'
    -b
    --background
    Go to background immediately after startup. If no output file is specified via the -o, output is redirected to wget-log.


    That part is everything that is between a -b and an empty line.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Jan 25 '15 at 22:57

























    answered Jan 23 '15 at 14:41









    chaos

    33.8k768112




    33.8k768112







    • 1




      print can be omitted
      – Costas
      Jan 23 '15 at 14:45










    • Thanks, I tried to use with GNU Awk 4.0.1(Ubuntu), GNU Awk 3.1.7(CentOS) and awk version 20070501(OS X), but works only with 4.0.1.
      – ironsand
      Jan 23 '15 at 19:10






    • 1




      .*$ can be omitted too
      – Walter Tross
      Jan 29 '15 at 22:13













    • 1




      print can be omitted
      – Costas
      Jan 23 '15 at 14:45










    • Thanks, I tried to use with GNU Awk 4.0.1(Ubuntu), GNU Awk 3.1.7(CentOS) and awk version 20070501(OS X), but works only with 4.0.1.
      – ironsand
      Jan 23 '15 at 19:10






    • 1




      .*$ can be omitted too
      – Walter Tross
      Jan 29 '15 at 22:13








    1




    1




    print can be omitted
    – Costas
    Jan 23 '15 at 14:45




    print can be omitted
    – Costas
    Jan 23 '15 at 14:45












    Thanks, I tried to use with GNU Awk 4.0.1(Ubuntu), GNU Awk 3.1.7(CentOS) and awk version 20070501(OS X), but works only with 4.0.1.
    – ironsand
    Jan 23 '15 at 19:10




    Thanks, I tried to use with GNU Awk 4.0.1(Ubuntu), GNU Awk 3.1.7(CentOS) and awk version 20070501(OS X), but works only with 4.0.1.
    – ironsand
    Jan 23 '15 at 19:10




    1




    1




    .*$ can be omitted too
    – Walter Tross
    Jan 29 '15 at 22:13





    .*$ can be omitted too
    – Walter Tross
    Jan 29 '15 at 22:13













    up vote
    21
    down vote













    If you use less as pager for man you can try



    LESS="+/^s+-b" man wget


    where




    1. + symbol to execute next operation after less has opened


    2. / command to start search


    3. ^s+-b regexp to match -b from start of line

    So if you like you can arrange the apropriate function for shell



    function rman 
    #USAGE: rman programm.name option.to.search (with "-" symbol)
    LESS="+/^s+$2" man "$1"



    and add it into ~/.bashrc for example.






    share|improve this answer






















    • This doesn't work for me, I think because it will not do multiline matching
      – rb612
      Jun 17 at 7:30














    up vote
    21
    down vote













    If you use less as pager for man you can try



    LESS="+/^s+-b" man wget


    where




    1. + symbol to execute next operation after less has opened


    2. / command to start search


    3. ^s+-b regexp to match -b from start of line

    So if you like you can arrange the apropriate function for shell



    function rman 
    #USAGE: rman programm.name option.to.search (with "-" symbol)
    LESS="+/^s+$2" man "$1"



    and add it into ~/.bashrc for example.






    share|improve this answer






















    • This doesn't work for me, I think because it will not do multiline matching
      – rb612
      Jun 17 at 7:30












    up vote
    21
    down vote










    up vote
    21
    down vote









    If you use less as pager for man you can try



    LESS="+/^s+-b" man wget


    where




    1. + symbol to execute next operation after less has opened


    2. / command to start search


    3. ^s+-b regexp to match -b from start of line

    So if you like you can arrange the apropriate function for shell



    function rman 
    #USAGE: rman programm.name option.to.search (with "-" symbol)
    LESS="+/^s+$2" man "$1"



    and add it into ~/.bashrc for example.






    share|improve this answer














    If you use less as pager for man you can try



    LESS="+/^s+-b" man wget


    where




    1. + symbol to execute next operation after less has opened


    2. / command to start search


    3. ^s+-b regexp to match -b from start of line

    So if you like you can arrange the apropriate function for shell



    function rman 
    #USAGE: rman programm.name option.to.search (with "-" symbol)
    LESS="+/^s+$2" man "$1"



    and add it into ~/.bashrc for example.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Jan 23 '15 at 14:22

























    answered Jan 23 '15 at 14:11









    Costas

    12.4k1029




    12.4k1029











    • This doesn't work for me, I think because it will not do multiline matching
      – rb612
      Jun 17 at 7:30
















    • This doesn't work for me, I think because it will not do multiline matching
      – rb612
      Jun 17 at 7:30















    This doesn't work for me, I think because it will not do multiline matching
    – rb612
    Jun 17 at 7:30




    This doesn't work for me, I think because it will not do multiline matching
    – rb612
    Jun 17 at 7:30










    up vote
    12
    down vote













    When you run man command you can press / and then enter the plain text to search for. For example, type /-b and it'll jump to the first instance of -b in the text.






    share|improve this answer
















    • 4




      And then n goes to the next instance.
      – drewbenn
      Jan 24 '15 at 6:13










    • @drewbenn Oh, nice. I've always just pressed /+enter to continue on.
      – fluffy
      Jan 25 '15 at 20:27














    up vote
    12
    down vote













    When you run man command you can press / and then enter the plain text to search for. For example, type /-b and it'll jump to the first instance of -b in the text.






    share|improve this answer
















    • 4




      And then n goes to the next instance.
      – drewbenn
      Jan 24 '15 at 6:13










    • @drewbenn Oh, nice. I've always just pressed /+enter to continue on.
      – fluffy
      Jan 25 '15 at 20:27












    up vote
    12
    down vote










    up vote
    12
    down vote









    When you run man command you can press / and then enter the plain text to search for. For example, type /-b and it'll jump to the first instance of -b in the text.






    share|improve this answer












    When you run man command you can press / and then enter the plain text to search for. For example, type /-b and it'll jump to the first instance of -b in the text.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Jan 23 '15 at 21:36









    fluffy

    42728




    42728







    • 4




      And then n goes to the next instance.
      – drewbenn
      Jan 24 '15 at 6:13










    • @drewbenn Oh, nice. I've always just pressed /+enter to continue on.
      – fluffy
      Jan 25 '15 at 20:27












    • 4




      And then n goes to the next instance.
      – drewbenn
      Jan 24 '15 at 6:13










    • @drewbenn Oh, nice. I've always just pressed /+enter to continue on.
      – fluffy
      Jan 25 '15 at 20:27







    4




    4




    And then n goes to the next instance.
    – drewbenn
    Jan 24 '15 at 6:13




    And then n goes to the next instance.
    – drewbenn
    Jan 24 '15 at 6:13












    @drewbenn Oh, nice. I've always just pressed /+enter to continue on.
    – fluffy
    Jan 25 '15 at 20:27




    @drewbenn Oh, nice. I've always just pressed /+enter to continue on.
    – fluffy
    Jan 25 '15 at 20:27










    up vote
    9
    down vote













    I wrote a small script to do this called he, e.g. he wget -b.



    The basic strategy is: search for the option (e.g. -b) as the first word on a line, then print until the next header, or next line with matching indentation.



    If you can't use that, you can get something similar using basic sed, e.g.



    man wget | sed -ne '/^ *-b/,/^$/p'





    share|improve this answer






















    • Also your desc script is very helpful.
      – Pandya
      Oct 4 '14 at 7:07










    • Just decided to rename it to he, as in short help, plus he/man.
      – Mikel
      Oct 4 '14 at 7:19










    • Updated to work with the new example, wget -b.
      – Mikel
      Jan 26 '15 at 7:59














    up vote
    9
    down vote













    I wrote a small script to do this called he, e.g. he wget -b.



    The basic strategy is: search for the option (e.g. -b) as the first word on a line, then print until the next header, or next line with matching indentation.



    If you can't use that, you can get something similar using basic sed, e.g.



    man wget | sed -ne '/^ *-b/,/^$/p'





    share|improve this answer






















    • Also your desc script is very helpful.
      – Pandya
      Oct 4 '14 at 7:07










    • Just decided to rename it to he, as in short help, plus he/man.
      – Mikel
      Oct 4 '14 at 7:19










    • Updated to work with the new example, wget -b.
      – Mikel
      Jan 26 '15 at 7:59












    up vote
    9
    down vote










    up vote
    9
    down vote









    I wrote a small script to do this called he, e.g. he wget -b.



    The basic strategy is: search for the option (e.g. -b) as the first word on a line, then print until the next header, or next line with matching indentation.



    If you can't use that, you can get something similar using basic sed, e.g.



    man wget | sed -ne '/^ *-b/,/^$/p'





    share|improve this answer














    I wrote a small script to do this called he, e.g. he wget -b.



    The basic strategy is: search for the option (e.g. -b) as the first word on a line, then print until the next header, or next line with matching indentation.



    If you can't use that, you can get something similar using basic sed, e.g.



    man wget | sed -ne '/^ *-b/,/^$/p'






    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Jan 26 '15 at 7:58

























    answered Oct 4 '14 at 6:21









    Mikel

    37.7k996121




    37.7k996121











    • Also your desc script is very helpful.
      – Pandya
      Oct 4 '14 at 7:07










    • Just decided to rename it to he, as in short help, plus he/man.
      – Mikel
      Oct 4 '14 at 7:19










    • Updated to work with the new example, wget -b.
      – Mikel
      Jan 26 '15 at 7:59
















    • Also your desc script is very helpful.
      – Pandya
      Oct 4 '14 at 7:07










    • Just decided to rename it to he, as in short help, plus he/man.
      – Mikel
      Oct 4 '14 at 7:19










    • Updated to work with the new example, wget -b.
      – Mikel
      Jan 26 '15 at 7:59















    Also your desc script is very helpful.
    – Pandya
    Oct 4 '14 at 7:07




    Also your desc script is very helpful.
    – Pandya
    Oct 4 '14 at 7:07












    Just decided to rename it to he, as in short help, plus he/man.
    – Mikel
    Oct 4 '14 at 7:19




    Just decided to rename it to he, as in short help, plus he/man.
    – Mikel
    Oct 4 '14 at 7:19












    Updated to work with the new example, wget -b.
    – Mikel
    Jan 26 '15 at 7:59




    Updated to work with the new example, wget -b.
    – Mikel
    Jan 26 '15 at 7:59










    up vote
    3
    down vote













    I use the following script that connects to explainshell.com. I copied it from reddit some time ago:



    #!/bin/bash
    cmd=$1
    shift
    args=$*
    args=$args/ /+
    w3m -dump "http://explainshell.com/explain/$cmd?args=$args"


    I named it rman and put it in my $PATH. Usage for wget -b:



    $ rman wget -b 
    [logo]

    • about
    •
    • [ ]

    wget(1) -b

    The non-interactive network downloader

    -b
    --background
    Go to background immediately after startup. If no output file is specified via the -o, output is
    redirected to wget-log.

    source manpages: wget


    You can tweak this script a little to not to show garbage at the beginning.



    EDIT: I got it from here. Thanks to the author!






    share|improve this answer


















    • 3




      It's important to note that this potentially documents a different implementation/version of the commands from those installed on the machine.
      – Stéphane Chazelas
      Jan 23 '15 at 14:11











    • Also, there's no escaping and bad quoting in the code.
      – l0b0
      Jan 23 '15 at 14:16










    • Yes, I wondered if I should emphasize that. However, if a particular option means something in one flavor of the program it usually means the same in another flavor. What is more often is that some options are missing. Again, this is just my experience.
      – Arkadiusz Drabczyk
      Jan 23 '15 at 14:16










    • @l0b0: I didn't write this code, I wouldn't use bash in the first place
      – Arkadiusz Drabczyk
      Jan 23 '15 at 14:17














    up vote
    3
    down vote













    I use the following script that connects to explainshell.com. I copied it from reddit some time ago:



    #!/bin/bash
    cmd=$1
    shift
    args=$*
    args=$args/ /+
    w3m -dump "http://explainshell.com/explain/$cmd?args=$args"


    I named it rman and put it in my $PATH. Usage for wget -b:



    $ rman wget -b 
    [logo]

    • about
    •
    • [ ]

    wget(1) -b

    The non-interactive network downloader

    -b
    --background
    Go to background immediately after startup. If no output file is specified via the -o, output is
    redirected to wget-log.

    source manpages: wget


    You can tweak this script a little to not to show garbage at the beginning.



    EDIT: I got it from here. Thanks to the author!






    share|improve this answer


















    • 3




      It's important to note that this potentially documents a different implementation/version of the commands from those installed on the machine.
      – Stéphane Chazelas
      Jan 23 '15 at 14:11











    • Also, there's no escaping and bad quoting in the code.
      – l0b0
      Jan 23 '15 at 14:16










    • Yes, I wondered if I should emphasize that. However, if a particular option means something in one flavor of the program it usually means the same in another flavor. What is more often is that some options are missing. Again, this is just my experience.
      – Arkadiusz Drabczyk
      Jan 23 '15 at 14:16










    • @l0b0: I didn't write this code, I wouldn't use bash in the first place
      – Arkadiusz Drabczyk
      Jan 23 '15 at 14:17












    up vote
    3
    down vote










    up vote
    3
    down vote









    I use the following script that connects to explainshell.com. I copied it from reddit some time ago:



    #!/bin/bash
    cmd=$1
    shift
    args=$*
    args=$args/ /+
    w3m -dump "http://explainshell.com/explain/$cmd?args=$args"


    I named it rman and put it in my $PATH. Usage for wget -b:



    $ rman wget -b 
    [logo]

    • about
    •
    • [ ]

    wget(1) -b

    The non-interactive network downloader

    -b
    --background
    Go to background immediately after startup. If no output file is specified via the -o, output is
    redirected to wget-log.

    source manpages: wget


    You can tweak this script a little to not to show garbage at the beginning.



    EDIT: I got it from here. Thanks to the author!






    share|improve this answer














    I use the following script that connects to explainshell.com. I copied it from reddit some time ago:



    #!/bin/bash
    cmd=$1
    shift
    args=$*
    args=$args/ /+
    w3m -dump "http://explainshell.com/explain/$cmd?args=$args"


    I named it rman and put it in my $PATH. Usage for wget -b:



    $ rman wget -b 
    [logo]

    • about
    •
    • [ ]

    wget(1) -b

    The non-interactive network downloader

    -b
    --background
    Go to background immediately after startup. If no output file is specified via the -o, output is
    redirected to wget-log.

    source manpages: wget


    You can tweak this script a little to not to show garbage at the beginning.



    EDIT: I got it from here. Thanks to the author!







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Jan 23 '15 at 14:10

























    answered Jan 23 '15 at 14:04









    Arkadiusz Drabczyk

    7,20521532




    7,20521532







    • 3




      It's important to note that this potentially documents a different implementation/version of the commands from those installed on the machine.
      – Stéphane Chazelas
      Jan 23 '15 at 14:11











    • Also, there's no escaping and bad quoting in the code.
      – l0b0
      Jan 23 '15 at 14:16










    • Yes, I wondered if I should emphasize that. However, if a particular option means something in one flavor of the program it usually means the same in another flavor. What is more often is that some options are missing. Again, this is just my experience.
      – Arkadiusz Drabczyk
      Jan 23 '15 at 14:16










    • @l0b0: I didn't write this code, I wouldn't use bash in the first place
      – Arkadiusz Drabczyk
      Jan 23 '15 at 14:17












    • 3




      It's important to note that this potentially documents a different implementation/version of the commands from those installed on the machine.
      – Stéphane Chazelas
      Jan 23 '15 at 14:11











    • Also, there's no escaping and bad quoting in the code.
      – l0b0
      Jan 23 '15 at 14:16










    • Yes, I wondered if I should emphasize that. However, if a particular option means something in one flavor of the program it usually means the same in another flavor. What is more often is that some options are missing. Again, this is just my experience.
      – Arkadiusz Drabczyk
      Jan 23 '15 at 14:16










    • @l0b0: I didn't write this code, I wouldn't use bash in the first place
      – Arkadiusz Drabczyk
      Jan 23 '15 at 14:17







    3




    3




    It's important to note that this potentially documents a different implementation/version of the commands from those installed on the machine.
    – Stéphane Chazelas
    Jan 23 '15 at 14:11





    It's important to note that this potentially documents a different implementation/version of the commands from those installed on the machine.
    – Stéphane Chazelas
    Jan 23 '15 at 14:11













    Also, there's no escaping and bad quoting in the code.
    – l0b0
    Jan 23 '15 at 14:16




    Also, there's no escaping and bad quoting in the code.
    – l0b0
    Jan 23 '15 at 14:16












    Yes, I wondered if I should emphasize that. However, if a particular option means something in one flavor of the program it usually means the same in another flavor. What is more often is that some options are missing. Again, this is just my experience.
    – Arkadiusz Drabczyk
    Jan 23 '15 at 14:16




    Yes, I wondered if I should emphasize that. However, if a particular option means something in one flavor of the program it usually means the same in another flavor. What is more often is that some options are missing. Again, this is just my experience.
    – Arkadiusz Drabczyk
    Jan 23 '15 at 14:16












    @l0b0: I didn't write this code, I wouldn't use bash in the first place
    – Arkadiusz Drabczyk
    Jan 23 '15 at 14:17




    @l0b0: I didn't write this code, I wouldn't use bash in the first place
    – Arkadiusz Drabczyk
    Jan 23 '15 at 14:17










    up vote
    0
    down vote













    Alternatively, if your grep is the GNU grep, you can use it as follows:



    man wget | grep -EA3 '^ *-b'


    In which -A (a GNU extension) is for print number of lines after matching lines (here 3). you can use appropriate number for complete description.



    Example:



    $ man wget | grep -EA3 '^ *-b'
    -b
    --background
    Go to background immediately after startup. If no output file is specified via the -o, output is
    redirected to wget-log.

    $ man grep | grep -EA3 '^ *-A'
    -A NUM, --after-context=NUM
    Print NUM lines of trailing context after matching lines. Places a line containing a group separator
    (--) between contiguous groups of matches. With the -o or --only-matching option, this has no effect
    and a warning is given.





    share|improve this answer


























      up vote
      0
      down vote













      Alternatively, if your grep is the GNU grep, you can use it as follows:



      man wget | grep -EA3 '^ *-b'


      In which -A (a GNU extension) is for print number of lines after matching lines (here 3). you can use appropriate number for complete description.



      Example:



      $ man wget | grep -EA3 '^ *-b'
      -b
      --background
      Go to background immediately after startup. If no output file is specified via the -o, output is
      redirected to wget-log.

      $ man grep | grep -EA3 '^ *-A'
      -A NUM, --after-context=NUM
      Print NUM lines of trailing context after matching lines. Places a line containing a group separator
      (--) between contiguous groups of matches. With the -o or --only-matching option, this has no effect
      and a warning is given.





      share|improve this answer
























        up vote
        0
        down vote










        up vote
        0
        down vote









        Alternatively, if your grep is the GNU grep, you can use it as follows:



        man wget | grep -EA3 '^ *-b'


        In which -A (a GNU extension) is for print number of lines after matching lines (here 3). you can use appropriate number for complete description.



        Example:



        $ man wget | grep -EA3 '^ *-b'
        -b
        --background
        Go to background immediately after startup. If no output file is specified via the -o, output is
        redirected to wget-log.

        $ man grep | grep -EA3 '^ *-A'
        -A NUM, --after-context=NUM
        Print NUM lines of trailing context after matching lines. Places a line containing a group separator
        (--) between contiguous groups of matches. With the -o or --only-matching option, this has no effect
        and a warning is given.





        share|improve this answer














        Alternatively, if your grep is the GNU grep, you can use it as follows:



        man wget | grep -EA3 '^ *-b'


        In which -A (a GNU extension) is for print number of lines after matching lines (here 3). you can use appropriate number for complete description.



        Example:



        $ man wget | grep -EA3 '^ *-b'
        -b
        --background
        Go to background immediately after startup. If no output file is specified via the -o, output is
        redirected to wget-log.

        $ man grep | grep -EA3 '^ *-A'
        -A NUM, --after-context=NUM
        Print NUM lines of trailing context after matching lines. Places a line containing a group separator
        (--) between contiguous groups of matches. With the -o or --only-matching option, this has no effect
        and a warning is given.






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jan 26 '15 at 15:42









        Stéphane Chazelas

        281k53518849




        281k53518849










        answered Jan 26 '15 at 12:31









        Pandya

        7,936114898




        7,936114898






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f180639%2fis-there-way-to-see-man-document-only-for-specified-option-of-a-command%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Displaying single band from multi-band raster using QGIS

            How many registers does an x86_64 CPU actually have?