easy way to just print the man page intro or description2019 Community Moderator ElectionHow can I print a section of a manual (man)?How to print (part of) a man page?Any way to cat few lines of man page to show on stdout for reference?Can't search for flags in qalter's man page?How to read this tcpdump man page?discrepancy between path for binary and man pageQuery Linux man page for certain flagRepeated values for errno in man pageWhat means the description in “ENOLCK” error return?How to list the available languages for a man page?Man page for file permission numbers
How to test the sharpness of a knife?
Air travel with refrigerated insulin
Offset in split text content
Why do Radio Buttons not fill the entire outer circle?
Why is participating in the European Parliamentary elections used as a threat?
Why would five hundred and five same as one?
What is this high flying aircraft over Pennsylvania?
Make a Bowl of Alphabet Soup
Did I make a mistake by ccing email to boss to others?
Mortal danger in mid-grade literature
When is the exact date for EOL of Ubuntu 14.04 LTS?
How do you say "Trust your struggle." in French?
1 John in Luther’s Bibel
How do I lift the insulation blower into the attic?
Showing mass murder in a kid's book
How to preserve electronics (computers, ipads, phones) for hundreds of years?
Do people actually use the word "kaputt" in conversation?
Is this saw blade faulty?
Hashing password to increase entropy
Do I have to take mana from my deck or hand when tapping this card?
Should a narrator ever describe things based on a character's view instead of facts?
"Marked down as someone wanting to sell shares." What does that mean?
Started in 1987 vs. Starting in 1987
Why is implicit conversion not ambiguous for non-primitive types?
easy way to just print the man page intro or description
2019 Community Moderator ElectionHow can I print a section of a manual (man)?How to print (part of) a man page?Any way to cat few lines of man page to show on stdout for reference?Can't search for flags in qalter's man page?How to read this tcpdump man page?discrepancy between path for binary and man pageQuery Linux man page for certain flagRepeated values for errno in man pageWhat means the description in “ENOLCK” error return?How to list the available languages for a man page?Man page for file permission numbers
Is there an easy way to quickly view a condensed summary of a man page: just the description description, or intro? I don't see an option/flag that does this, is there another tool that does this for you?
man
add a comment |
Is there an easy way to quickly view a condensed summary of a man page: just the description description, or intro? I don't see an option/flag that does this, is there another tool that does this for you?
man
add a comment |
Is there an easy way to quickly view a condensed summary of a man page: just the description description, or intro? I don't see an option/flag that does this, is there another tool that does this for you?
man
Is there an easy way to quickly view a condensed summary of a man page: just the description description, or intro? I don't see an option/flag that does this, is there another tool that does this for you?
man
man
edited Mar 9 '16 at 23:56
Gilles
543k12811001617
543k12811001617
asked Mar 9 '16 at 18:54
OscalationOscalation
3242618
3242618
add a comment |
add a comment |
5 Answers
5
active
oldest
votes
The condensed summary referred to by OP is likely the NAME section, which is treated specially by mandb
or makewhatis
(to prepare data for whatis
and apropos
.
By convention, this is a single line in those tools (although it may be wrapped due to length in the actual manpage). Also (still convention), there is a dash between the topic (on the left) and the short description.
Further reading (Linux):
Linux manual page forman(1)
has more than one useful option using this data:
man -k
printf
Search the short descriptions and manual page names for the
keyword printf as regular expression. Print out any matches.
Equivalent toapropos printf
.
man -f
smail
Lookup the manual pages referenced bysmail
and print out the
short descriptions of any found. Equivalent towhatis smail
.
The apropos
listing gives more results since it shows matches on any part of the line in the short description. For example, apropos printf
might show
asprintf (3) - print to allocated string
dprintf (3) - print to a file descriptor
fprintf (3) - formatted output conversion
fwprintf (3) - formatted wide-character output conversion
printf (1) - format and print data
printf (3) - formatted output conversion
snprintf (3) - formatted output conversion
sprintf (3) - formatted output conversion
swprintf (3) - formatted wide-character output conversion
vasprintf (3) - print to allocated string
vdprintf (3) - print to a file descriptor
vfprintf (3) - formatted output conversion
vfwprintf (3) - formatted wide-character output conversion
vprintf (3) - formatted output conversion
vsnprintf (3) - formatted output conversion
vsprintf (3) - formatted output conversion
vswprintf (3) - formatted wide-character output conversion
vwprintf (3) - formatted wide-character output conversion
wprintf (3) - formatted wide-character output conversion
XtAsprintf (3) - memory management functions
But whatis
looks for pages with the given topic name:
printf (1) - format and print data
printf (3) - formatted output conversion
Linux manual page forman-pages(7)
describes the structure.
Other systems can differ:
OSX manual page forman(1)
, option-k
is equivalent toapropos
. In turn,apropos
DESCRIPTION says "apropos searches a set of database files containing short descriptions of system commands for key-words keywords words and displays the result on the standard output.", while its NAME section says "apropos - search the whatis database for strings".
OSX manual page formanpages(5)
gives the structure of manpages.
While the man
program in each case can have options corresponding to apropos
and whatis
, the separate programs are more commonly used across various Unix-like systems.
Interestingly, POSIX has only man
(and the -k
option), with no match for whatis
. In the rationale, it is noted
The
-f
option was considered, but due to implementation differences, it was not included in this volume of POSIX.1-2008.
Also, POSIX does not use the term apropos, but describes it. Likewise POSIX does not (in that section, at least) attempt to describe the structure of individual manpages nor how they are organized into sections. Those are system-dependent features.
add a comment |
Depending on what you mean by "description", man
has an option:
-f, --whatis
Equivalent to whatis. Display a short description from the man‐
ual page, if available. See whatis(1) for details.
So:
$ man -f man
man (7) - macros to format man pages
man (1) - an interface to the on-line reference manuals
man (1p) - display system documentation
$ whatis man
man (7) - macros to format man pages
man (1) - an interface to the on-line reference manuals
man (1p) - display system documentation
add a comment |
Some commands support `--help or -h' which can give brief usage.
For specifically the man pages, I would suggest as an "easy" way is
man | head -15 #Number of lines can be different for each man page
There are some other ways, such as writing a small function and setting as an alias.
Something to get you started:
function readManDesc()
manPage="$1"
if [ -z "$2" ]; then
count="10"
else
count="$2"
fi
man $manPage
readManDesc $@
alias mandesc="bash manPageDesc.sh"
Usage: mandesc <command> <lines to count after DESCRIPTION>
add a comment |
These couple of functions show subsection and extract specific subsection, I'm sure they can be improved though:
Use:
mansubs < command >
manedit < command > < subsection >
mansubs() col -bx
manedit() awk -v S="$2" '$0 ~ S cap="true"; print $0 !~ S && /^[A-Z ]+$/ cap="false" $0 !~ S && !/^[A-Z ]+$/ if(cap == "true")print'
For instance:
$ mansubs grep
NAME
SYNOPSIS
DESCRIPTION
OPTIONS
REGULAR EXPRESSIONS
ENVIRONMENT VARIABLES
EXIT STATUS
COPYRIGHT
BUGS
SEE ALSO
NOTES
$ manedit grep SYNOPSIS
SYNOPSIS
grep [OPTIONS] PATTERN [FILE...]
grep [OPTIONS] [-e PATTERN | -f FILE] [FILE...]
add a comment |
if you mean just the description part of the man page before getting into the command line switches
man <command> | col -b > /tmp/randomtempfile
then using grep
and sed
you can extract however much information you need from the randomtempfile
. As far as I know, man doesn't have an option to display summary pages.
add a comment |
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',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
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
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f268730%2feasy-way-to-just-print-the-man-page-intro-or-description%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
The condensed summary referred to by OP is likely the NAME section, which is treated specially by mandb
or makewhatis
(to prepare data for whatis
and apropos
.
By convention, this is a single line in those tools (although it may be wrapped due to length in the actual manpage). Also (still convention), there is a dash between the topic (on the left) and the short description.
Further reading (Linux):
Linux manual page forman(1)
has more than one useful option using this data:
man -k
printf
Search the short descriptions and manual page names for the
keyword printf as regular expression. Print out any matches.
Equivalent toapropos printf
.
man -f
smail
Lookup the manual pages referenced bysmail
and print out the
short descriptions of any found. Equivalent towhatis smail
.
The apropos
listing gives more results since it shows matches on any part of the line in the short description. For example, apropos printf
might show
asprintf (3) - print to allocated string
dprintf (3) - print to a file descriptor
fprintf (3) - formatted output conversion
fwprintf (3) - formatted wide-character output conversion
printf (1) - format and print data
printf (3) - formatted output conversion
snprintf (3) - formatted output conversion
sprintf (3) - formatted output conversion
swprintf (3) - formatted wide-character output conversion
vasprintf (3) - print to allocated string
vdprintf (3) - print to a file descriptor
vfprintf (3) - formatted output conversion
vfwprintf (3) - formatted wide-character output conversion
vprintf (3) - formatted output conversion
vsnprintf (3) - formatted output conversion
vsprintf (3) - formatted output conversion
vswprintf (3) - formatted wide-character output conversion
vwprintf (3) - formatted wide-character output conversion
wprintf (3) - formatted wide-character output conversion
XtAsprintf (3) - memory management functions
But whatis
looks for pages with the given topic name:
printf (1) - format and print data
printf (3) - formatted output conversion
Linux manual page forman-pages(7)
describes the structure.
Other systems can differ:
OSX manual page forman(1)
, option-k
is equivalent toapropos
. In turn,apropos
DESCRIPTION says "apropos searches a set of database files containing short descriptions of system commands for key-words keywords words and displays the result on the standard output.", while its NAME section says "apropos - search the whatis database for strings".
OSX manual page formanpages(5)
gives the structure of manpages.
While the man
program in each case can have options corresponding to apropos
and whatis
, the separate programs are more commonly used across various Unix-like systems.
Interestingly, POSIX has only man
(and the -k
option), with no match for whatis
. In the rationale, it is noted
The
-f
option was considered, but due to implementation differences, it was not included in this volume of POSIX.1-2008.
Also, POSIX does not use the term apropos, but describes it. Likewise POSIX does not (in that section, at least) attempt to describe the structure of individual manpages nor how they are organized into sections. Those are system-dependent features.
add a comment |
The condensed summary referred to by OP is likely the NAME section, which is treated specially by mandb
or makewhatis
(to prepare data for whatis
and apropos
.
By convention, this is a single line in those tools (although it may be wrapped due to length in the actual manpage). Also (still convention), there is a dash between the topic (on the left) and the short description.
Further reading (Linux):
Linux manual page forman(1)
has more than one useful option using this data:
man -k
printf
Search the short descriptions and manual page names for the
keyword printf as regular expression. Print out any matches.
Equivalent toapropos printf
.
man -f
smail
Lookup the manual pages referenced bysmail
and print out the
short descriptions of any found. Equivalent towhatis smail
.
The apropos
listing gives more results since it shows matches on any part of the line in the short description. For example, apropos printf
might show
asprintf (3) - print to allocated string
dprintf (3) - print to a file descriptor
fprintf (3) - formatted output conversion
fwprintf (3) - formatted wide-character output conversion
printf (1) - format and print data
printf (3) - formatted output conversion
snprintf (3) - formatted output conversion
sprintf (3) - formatted output conversion
swprintf (3) - formatted wide-character output conversion
vasprintf (3) - print to allocated string
vdprintf (3) - print to a file descriptor
vfprintf (3) - formatted output conversion
vfwprintf (3) - formatted wide-character output conversion
vprintf (3) - formatted output conversion
vsnprintf (3) - formatted output conversion
vsprintf (3) - formatted output conversion
vswprintf (3) - formatted wide-character output conversion
vwprintf (3) - formatted wide-character output conversion
wprintf (3) - formatted wide-character output conversion
XtAsprintf (3) - memory management functions
But whatis
looks for pages with the given topic name:
printf (1) - format and print data
printf (3) - formatted output conversion
Linux manual page forman-pages(7)
describes the structure.
Other systems can differ:
OSX manual page forman(1)
, option-k
is equivalent toapropos
. In turn,apropos
DESCRIPTION says "apropos searches a set of database files containing short descriptions of system commands for key-words keywords words and displays the result on the standard output.", while its NAME section says "apropos - search the whatis database for strings".
OSX manual page formanpages(5)
gives the structure of manpages.
While the man
program in each case can have options corresponding to apropos
and whatis
, the separate programs are more commonly used across various Unix-like systems.
Interestingly, POSIX has only man
(and the -k
option), with no match for whatis
. In the rationale, it is noted
The
-f
option was considered, but due to implementation differences, it was not included in this volume of POSIX.1-2008.
Also, POSIX does not use the term apropos, but describes it. Likewise POSIX does not (in that section, at least) attempt to describe the structure of individual manpages nor how they are organized into sections. Those are system-dependent features.
add a comment |
The condensed summary referred to by OP is likely the NAME section, which is treated specially by mandb
or makewhatis
(to prepare data for whatis
and apropos
.
By convention, this is a single line in those tools (although it may be wrapped due to length in the actual manpage). Also (still convention), there is a dash between the topic (on the left) and the short description.
Further reading (Linux):
Linux manual page forman(1)
has more than one useful option using this data:
man -k
printf
Search the short descriptions and manual page names for the
keyword printf as regular expression. Print out any matches.
Equivalent toapropos printf
.
man -f
smail
Lookup the manual pages referenced bysmail
and print out the
short descriptions of any found. Equivalent towhatis smail
.
The apropos
listing gives more results since it shows matches on any part of the line in the short description. For example, apropos printf
might show
asprintf (3) - print to allocated string
dprintf (3) - print to a file descriptor
fprintf (3) - formatted output conversion
fwprintf (3) - formatted wide-character output conversion
printf (1) - format and print data
printf (3) - formatted output conversion
snprintf (3) - formatted output conversion
sprintf (3) - formatted output conversion
swprintf (3) - formatted wide-character output conversion
vasprintf (3) - print to allocated string
vdprintf (3) - print to a file descriptor
vfprintf (3) - formatted output conversion
vfwprintf (3) - formatted wide-character output conversion
vprintf (3) - formatted output conversion
vsnprintf (3) - formatted output conversion
vsprintf (3) - formatted output conversion
vswprintf (3) - formatted wide-character output conversion
vwprintf (3) - formatted wide-character output conversion
wprintf (3) - formatted wide-character output conversion
XtAsprintf (3) - memory management functions
But whatis
looks for pages with the given topic name:
printf (1) - format and print data
printf (3) - formatted output conversion
Linux manual page forman-pages(7)
describes the structure.
Other systems can differ:
OSX manual page forman(1)
, option-k
is equivalent toapropos
. In turn,apropos
DESCRIPTION says "apropos searches a set of database files containing short descriptions of system commands for key-words keywords words and displays the result on the standard output.", while its NAME section says "apropos - search the whatis database for strings".
OSX manual page formanpages(5)
gives the structure of manpages.
While the man
program in each case can have options corresponding to apropos
and whatis
, the separate programs are more commonly used across various Unix-like systems.
Interestingly, POSIX has only man
(and the -k
option), with no match for whatis
. In the rationale, it is noted
The
-f
option was considered, but due to implementation differences, it was not included in this volume of POSIX.1-2008.
Also, POSIX does not use the term apropos, but describes it. Likewise POSIX does not (in that section, at least) attempt to describe the structure of individual manpages nor how they are organized into sections. Those are system-dependent features.
The condensed summary referred to by OP is likely the NAME section, which is treated specially by mandb
or makewhatis
(to prepare data for whatis
and apropos
.
By convention, this is a single line in those tools (although it may be wrapped due to length in the actual manpage). Also (still convention), there is a dash between the topic (on the left) and the short description.
Further reading (Linux):
Linux manual page forman(1)
has more than one useful option using this data:
man -k
printf
Search the short descriptions and manual page names for the
keyword printf as regular expression. Print out any matches.
Equivalent toapropos printf
.
man -f
smail
Lookup the manual pages referenced bysmail
and print out the
short descriptions of any found. Equivalent towhatis smail
.
The apropos
listing gives more results since it shows matches on any part of the line in the short description. For example, apropos printf
might show
asprintf (3) - print to allocated string
dprintf (3) - print to a file descriptor
fprintf (3) - formatted output conversion
fwprintf (3) - formatted wide-character output conversion
printf (1) - format and print data
printf (3) - formatted output conversion
snprintf (3) - formatted output conversion
sprintf (3) - formatted output conversion
swprintf (3) - formatted wide-character output conversion
vasprintf (3) - print to allocated string
vdprintf (3) - print to a file descriptor
vfprintf (3) - formatted output conversion
vfwprintf (3) - formatted wide-character output conversion
vprintf (3) - formatted output conversion
vsnprintf (3) - formatted output conversion
vsprintf (3) - formatted output conversion
vswprintf (3) - formatted wide-character output conversion
vwprintf (3) - formatted wide-character output conversion
wprintf (3) - formatted wide-character output conversion
XtAsprintf (3) - memory management functions
But whatis
looks for pages with the given topic name:
printf (1) - format and print data
printf (3) - formatted output conversion
Linux manual page forman-pages(7)
describes the structure.
Other systems can differ:
OSX manual page forman(1)
, option-k
is equivalent toapropos
. In turn,apropos
DESCRIPTION says "apropos searches a set of database files containing short descriptions of system commands for key-words keywords words and displays the result on the standard output.", while its NAME section says "apropos - search the whatis database for strings".
OSX manual page formanpages(5)
gives the structure of manpages.
While the man
program in each case can have options corresponding to apropos
and whatis
, the separate programs are more commonly used across various Unix-like systems.
Interestingly, POSIX has only man
(and the -k
option), with no match for whatis
. In the rationale, it is noted
The
-f
option was considered, but due to implementation differences, it was not included in this volume of POSIX.1-2008.
Also, POSIX does not use the term apropos, but describes it. Likewise POSIX does not (in that section, at least) attempt to describe the structure of individual manpages nor how they are organized into sections. Those are system-dependent features.
edited Mar 10 '16 at 0:00
answered Mar 9 '16 at 23:54
Thomas DickeyThomas Dickey
53.9k5103176
53.9k5103176
add a comment |
add a comment |
Depending on what you mean by "description", man
has an option:
-f, --whatis
Equivalent to whatis. Display a short description from the man‐
ual page, if available. See whatis(1) for details.
So:
$ man -f man
man (7) - macros to format man pages
man (1) - an interface to the on-line reference manuals
man (1p) - display system documentation
$ whatis man
man (7) - macros to format man pages
man (1) - an interface to the on-line reference manuals
man (1p) - display system documentation
add a comment |
Depending on what you mean by "description", man
has an option:
-f, --whatis
Equivalent to whatis. Display a short description from the man‐
ual page, if available. See whatis(1) for details.
So:
$ man -f man
man (7) - macros to format man pages
man (1) - an interface to the on-line reference manuals
man (1p) - display system documentation
$ whatis man
man (7) - macros to format man pages
man (1) - an interface to the on-line reference manuals
man (1p) - display system documentation
add a comment |
Depending on what you mean by "description", man
has an option:
-f, --whatis
Equivalent to whatis. Display a short description from the man‐
ual page, if available. See whatis(1) for details.
So:
$ man -f man
man (7) - macros to format man pages
man (1) - an interface to the on-line reference manuals
man (1p) - display system documentation
$ whatis man
man (7) - macros to format man pages
man (1) - an interface to the on-line reference manuals
man (1p) - display system documentation
Depending on what you mean by "description", man
has an option:
-f, --whatis
Equivalent to whatis. Display a short description from the man‐
ual page, if available. See whatis(1) for details.
So:
$ man -f man
man (7) - macros to format man pages
man (1) - an interface to the on-line reference manuals
man (1p) - display system documentation
$ whatis man
man (7) - macros to format man pages
man (1) - an interface to the on-line reference manuals
man (1p) - display system documentation
answered Mar 9 '16 at 22:50
murumuru
1
1
add a comment |
add a comment |
Some commands support `--help or -h' which can give brief usage.
For specifically the man pages, I would suggest as an "easy" way is
man | head -15 #Number of lines can be different for each man page
There are some other ways, such as writing a small function and setting as an alias.
Something to get you started:
function readManDesc()
manPage="$1"
if [ -z "$2" ]; then
count="10"
else
count="$2"
fi
man $manPage
readManDesc $@
alias mandesc="bash manPageDesc.sh"
Usage: mandesc <command> <lines to count after DESCRIPTION>
add a comment |
Some commands support `--help or -h' which can give brief usage.
For specifically the man pages, I would suggest as an "easy" way is
man | head -15 #Number of lines can be different for each man page
There are some other ways, such as writing a small function and setting as an alias.
Something to get you started:
function readManDesc()
manPage="$1"
if [ -z "$2" ]; then
count="10"
else
count="$2"
fi
man $manPage
readManDesc $@
alias mandesc="bash manPageDesc.sh"
Usage: mandesc <command> <lines to count after DESCRIPTION>
add a comment |
Some commands support `--help or -h' which can give brief usage.
For specifically the man pages, I would suggest as an "easy" way is
man | head -15 #Number of lines can be different for each man page
There are some other ways, such as writing a small function and setting as an alias.
Something to get you started:
function readManDesc()
manPage="$1"
if [ -z "$2" ]; then
count="10"
else
count="$2"
fi
man $manPage
readManDesc $@
alias mandesc="bash manPageDesc.sh"
Usage: mandesc <command> <lines to count after DESCRIPTION>
Some commands support `--help or -h' which can give brief usage.
For specifically the man pages, I would suggest as an "easy" way is
man | head -15 #Number of lines can be different for each man page
There are some other ways, such as writing a small function and setting as an alias.
Something to get you started:
function readManDesc()
manPage="$1"
if [ -z "$2" ]; then
count="10"
else
count="$2"
fi
man $manPage
readManDesc $@
alias mandesc="bash manPageDesc.sh"
Usage: mandesc <command> <lines to count after DESCRIPTION>
edited Mar 10 '16 at 20:24
answered Mar 9 '16 at 22:31
J LJ L
10113
10113
add a comment |
add a comment |
These couple of functions show subsection and extract specific subsection, I'm sure they can be improved though:
Use:
mansubs < command >
manedit < command > < subsection >
mansubs() col -bx
manedit() awk -v S="$2" '$0 ~ S cap="true"; print $0 !~ S && /^[A-Z ]+$/ cap="false" $0 !~ S && !/^[A-Z ]+$/ if(cap == "true")print'
For instance:
$ mansubs grep
NAME
SYNOPSIS
DESCRIPTION
OPTIONS
REGULAR EXPRESSIONS
ENVIRONMENT VARIABLES
EXIT STATUS
COPYRIGHT
BUGS
SEE ALSO
NOTES
$ manedit grep SYNOPSIS
SYNOPSIS
grep [OPTIONS] PATTERN [FILE...]
grep [OPTIONS] [-e PATTERN | -f FILE] [FILE...]
add a comment |
These couple of functions show subsection and extract specific subsection, I'm sure they can be improved though:
Use:
mansubs < command >
manedit < command > < subsection >
mansubs() col -bx
manedit() awk -v S="$2" '$0 ~ S cap="true"; print $0 !~ S && /^[A-Z ]+$/ cap="false" $0 !~ S && !/^[A-Z ]+$/ if(cap == "true")print'
For instance:
$ mansubs grep
NAME
SYNOPSIS
DESCRIPTION
OPTIONS
REGULAR EXPRESSIONS
ENVIRONMENT VARIABLES
EXIT STATUS
COPYRIGHT
BUGS
SEE ALSO
NOTES
$ manedit grep SYNOPSIS
SYNOPSIS
grep [OPTIONS] PATTERN [FILE...]
grep [OPTIONS] [-e PATTERN | -f FILE] [FILE...]
add a comment |
These couple of functions show subsection and extract specific subsection, I'm sure they can be improved though:
Use:
mansubs < command >
manedit < command > < subsection >
mansubs() col -bx
manedit() awk -v S="$2" '$0 ~ S cap="true"; print $0 !~ S && /^[A-Z ]+$/ cap="false" $0 !~ S && !/^[A-Z ]+$/ if(cap == "true")print'
For instance:
$ mansubs grep
NAME
SYNOPSIS
DESCRIPTION
OPTIONS
REGULAR EXPRESSIONS
ENVIRONMENT VARIABLES
EXIT STATUS
COPYRIGHT
BUGS
SEE ALSO
NOTES
$ manedit grep SYNOPSIS
SYNOPSIS
grep [OPTIONS] PATTERN [FILE...]
grep [OPTIONS] [-e PATTERN | -f FILE] [FILE...]
These couple of functions show subsection and extract specific subsection, I'm sure they can be improved though:
Use:
mansubs < command >
manedit < command > < subsection >
mansubs() col -bx
manedit() awk -v S="$2" '$0 ~ S cap="true"; print $0 !~ S && /^[A-Z ]+$/ cap="false" $0 !~ S && !/^[A-Z ]+$/ if(cap == "true")print'
For instance:
$ mansubs grep
NAME
SYNOPSIS
DESCRIPTION
OPTIONS
REGULAR EXPRESSIONS
ENVIRONMENT VARIABLES
EXIT STATUS
COPYRIGHT
BUGS
SEE ALSO
NOTES
$ manedit grep SYNOPSIS
SYNOPSIS
grep [OPTIONS] PATTERN [FILE...]
grep [OPTIONS] [-e PATTERN | -f FILE] [FILE...]
answered 14 hours ago
XAVIXAVI
861
861
add a comment |
add a comment |
if you mean just the description part of the man page before getting into the command line switches
man <command> | col -b > /tmp/randomtempfile
then using grep
and sed
you can extract however much information you need from the randomtempfile
. As far as I know, man doesn't have an option to display summary pages.
add a comment |
if you mean just the description part of the man page before getting into the command line switches
man <command> | col -b > /tmp/randomtempfile
then using grep
and sed
you can extract however much information you need from the randomtempfile
. As far as I know, man doesn't have an option to display summary pages.
add a comment |
if you mean just the description part of the man page before getting into the command line switches
man <command> | col -b > /tmp/randomtempfile
then using grep
and sed
you can extract however much information you need from the randomtempfile
. As far as I know, man doesn't have an option to display summary pages.
if you mean just the description part of the man page before getting into the command line switches
man <command> | col -b > /tmp/randomtempfile
then using grep
and sed
you can extract however much information you need from the randomtempfile
. As far as I know, man doesn't have an option to display summary pages.
answered Mar 9 '16 at 20:50
MelBurslanMelBurslan
5,34611533
5,34611533
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f268730%2feasy-way-to-just-print-the-man-page-intro-or-description%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown