Is there way to see `man` document only for specified option of a command
Clash Royale CLAN TAG#URR8PPP
up vote
22
down vote
favorite
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?
man options
add a comment |Â
up vote
22
down vote
favorite
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?
man options
wget -h | grep '-b'
â Faheem Mitha
Jan 23 '15 at 14:29
add a comment |Â
up vote
22
down vote
favorite
up vote
22
down vote
favorite
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?
man options
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?
man options
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
add a comment |Â
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
add a comment |Â
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.
1
print
can be omitted
â Costas
Jan 23 '15 at 14:45
Thanks, I tried to use withGNU Awk 4.0.1(Ubuntu)
,GNU Awk 3.1.7(CentOS)
andawk version 20070501(OS X)
, but works only with4.0.1
.
â ironsand
Jan 23 '15 at 19:10
1
.*$
can be omitted too
â Walter Tross
Jan 29 '15 at 22:13
add a comment |Â
up vote
21
down vote
If you use less
as pager for man you can try
LESS="+/^s+-b" man wget
where
+
symbol to execute next operation afterless
has opened/
command to start search^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.
This doesn't work for me, I think because it will not do multiline matching
â rb612
Jun 17 at 7:30
add a comment |Â
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.
4
And thenn
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
add a comment |Â
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'
Also your desc script is very helpful.
â Pandya
Oct 4 '14 at 7:07
Just decided to rename it tohe
, as inshort help
, plushe
/man
.
â Mikel
Oct 4 '14 at 7:19
Updated to work with the new example,wget -b
.
â Mikel
Jan 26 '15 at 7:59
add a comment |Â
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!
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
add a comment |Â
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.
add a comment |Â
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.
1
print
can be omitted
â Costas
Jan 23 '15 at 14:45
Thanks, I tried to use withGNU Awk 4.0.1(Ubuntu)
,GNU Awk 3.1.7(CentOS)
andawk version 20070501(OS X)
, but works only with4.0.1
.
â ironsand
Jan 23 '15 at 19:10
1
.*$
can be omitted too
â Walter Tross
Jan 29 '15 at 22:13
add a comment |Â
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.
1
print
can be omitted
â Costas
Jan 23 '15 at 14:45
Thanks, I tried to use withGNU Awk 4.0.1(Ubuntu)
,GNU Awk 3.1.7(CentOS)
andawk version 20070501(OS X)
, but works only with4.0.1
.
â ironsand
Jan 23 '15 at 19:10
1
.*$
can be omitted too
â Walter Tross
Jan 29 '15 at 22:13
add a comment |Â
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.
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.
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 withGNU Awk 4.0.1(Ubuntu)
,GNU Awk 3.1.7(CentOS)
andawk version 20070501(OS X)
, but works only with4.0.1
.
â ironsand
Jan 23 '15 at 19:10
1
.*$
can be omitted too
â Walter Tross
Jan 29 '15 at 22:13
add a comment |Â
1
print
can be omitted
â Costas
Jan 23 '15 at 14:45
Thanks, I tried to use withGNU Awk 4.0.1(Ubuntu)
,GNU Awk 3.1.7(CentOS)
andawk version 20070501(OS X)
, but works only with4.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
add a comment |Â
up vote
21
down vote
If you use less
as pager for man you can try
LESS="+/^s+-b" man wget
where
+
symbol to execute next operation afterless
has opened/
command to start search^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.
This doesn't work for me, I think because it will not do multiline matching
â rb612
Jun 17 at 7:30
add a comment |Â
up vote
21
down vote
If you use less
as pager for man you can try
LESS="+/^s+-b" man wget
where
+
symbol to execute next operation afterless
has opened/
command to start search^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.
This doesn't work for me, I think because it will not do multiline matching
â rb612
Jun 17 at 7:30
add a comment |Â
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
+
symbol to execute next operation afterless
has opened/
command to start search^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.
If you use less
as pager for man you can try
LESS="+/^s+-b" man wget
where
+
symbol to execute next operation afterless
has opened/
command to start search^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.
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
add a comment |Â
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
add a comment |Â
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.
4
And thenn
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
add a comment |Â
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.
4
And thenn
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
add a comment |Â
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.
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.
answered Jan 23 '15 at 21:36
fluffy
42728
42728
4
And thenn
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
add a comment |Â
4
And thenn
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
add a comment |Â
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'
Also your desc script is very helpful.
â Pandya
Oct 4 '14 at 7:07
Just decided to rename it tohe
, as inshort help
, plushe
/man
.
â Mikel
Oct 4 '14 at 7:19
Updated to work with the new example,wget -b
.
â Mikel
Jan 26 '15 at 7:59
add a comment |Â
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'
Also your desc script is very helpful.
â Pandya
Oct 4 '14 at 7:07
Just decided to rename it tohe
, as inshort help
, plushe
/man
.
â Mikel
Oct 4 '14 at 7:19
Updated to work with the new example,wget -b
.
â Mikel
Jan 26 '15 at 7:59
add a comment |Â
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'
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'
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 tohe
, as inshort help
, plushe
/man
.
â Mikel
Oct 4 '14 at 7:19
Updated to work with the new example,wget -b
.
â Mikel
Jan 26 '15 at 7:59
add a comment |Â
Also your desc script is very helpful.
â Pandya
Oct 4 '14 at 7:07
Just decided to rename it tohe
, as inshort help
, plushe
/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
add a comment |Â
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!
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
add a comment |Â
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!
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
add a comment |Â
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!
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!
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
add a comment |Â
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
add a comment |Â
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.
add a comment |Â
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.
add a comment |Â
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.
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.
edited Jan 26 '15 at 15:42
Stéphane Chazelas
281k53518849
281k53518849
answered Jan 26 '15 at 12:31
Pandya
7,936114898
7,936114898
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
wget -h | grep '-b'
â Faheem Mitha
Jan 23 '15 at 14:29