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










1















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?










share|improve this question




























    1















    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?










    share|improve this question


























      1












      1








      1








      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?










      share|improve this question
















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 9 '16 at 23:56









      Gilles

      543k12811001617




      543k12811001617










      asked Mar 9 '16 at 18:54









      OscalationOscalation

      3242618




      3242618




















          5 Answers
          5






          active

          oldest

          votes


















          4














          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 for man(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 to apropos printf.



          man -f smail

          Lookup the manual pages referenced by smail and print out the
          short descriptions of any found. Equivalent to whatis 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 for man-pages(7) describes the structure.

          Other systems can differ:




          • OSX manual page for man(1), option -k is equivalent to apropos. 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 for manpages(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.






          share|improve this answer
































            1














            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





            share|improve this answer






























              1














              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>





              share|improve this answer
































                1














                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...]





                share|improve this answer






























                  0














                  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.






                  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',
                    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
                    );



                    );













                    draft saved

                    draft discarded


















                    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









                    4














                    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 for man(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 to apropos printf.



                    man -f smail

                    Lookup the manual pages referenced by smail and print out the
                    short descriptions of any found. Equivalent to whatis 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 for man-pages(7) describes the structure.

                    Other systems can differ:




                    • OSX manual page for man(1), option -k is equivalent to apropos. 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 for manpages(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.






                    share|improve this answer





























                      4














                      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 for man(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 to apropos printf.



                      man -f smail

                      Lookup the manual pages referenced by smail and print out the
                      short descriptions of any found. Equivalent to whatis 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 for man-pages(7) describes the structure.

                      Other systems can differ:




                      • OSX manual page for man(1), option -k is equivalent to apropos. 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 for manpages(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.






                      share|improve this answer



























                        4












                        4








                        4







                        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 for man(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 to apropos printf.



                        man -f smail

                        Lookup the manual pages referenced by smail and print out the
                        short descriptions of any found. Equivalent to whatis 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 for man-pages(7) describes the structure.

                        Other systems can differ:




                        • OSX manual page for man(1), option -k is equivalent to apropos. 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 for manpages(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.






                        share|improve this answer















                        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 for man(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 to apropos printf.



                        man -f smail

                        Lookup the manual pages referenced by smail and print out the
                        short descriptions of any found. Equivalent to whatis 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 for man-pages(7) describes the structure.

                        Other systems can differ:




                        • OSX manual page for man(1), option -k is equivalent to apropos. 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 for manpages(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.







                        share|improve this answer














                        share|improve this answer



                        share|improve this answer








                        edited Mar 10 '16 at 0:00

























                        answered Mar 9 '16 at 23:54









                        Thomas DickeyThomas Dickey

                        53.9k5103176




                        53.9k5103176























                            1














                            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





                            share|improve this answer



























                              1














                              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





                              share|improve this answer

























                                1












                                1








                                1







                                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





                                share|improve this answer













                                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






                                share|improve this answer












                                share|improve this answer



                                share|improve this answer










                                answered Mar 9 '16 at 22:50









                                murumuru

                                1




                                1





















                                    1














                                    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>





                                    share|improve this answer





























                                      1














                                      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>





                                      share|improve this answer



























                                        1












                                        1








                                        1







                                        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>





                                        share|improve this answer















                                        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>






                                        share|improve this answer














                                        share|improve this answer



                                        share|improve this answer








                                        edited Mar 10 '16 at 20:24

























                                        answered Mar 9 '16 at 22:31









                                        J LJ L

                                        10113




                                        10113





















                                            1














                                            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...]





                                            share|improve this answer



























                                              1














                                              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...]





                                              share|improve this answer

























                                                1












                                                1








                                                1







                                                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...]





                                                share|improve this answer













                                                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...]






                                                share|improve this answer












                                                share|improve this answer



                                                share|improve this answer










                                                answered 14 hours ago









                                                XAVIXAVI

                                                861




                                                861





















                                                    0














                                                    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.






                                                    share|improve this answer



























                                                      0














                                                      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.






                                                      share|improve this answer

























                                                        0












                                                        0








                                                        0







                                                        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.






                                                        share|improve this answer













                                                        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.







                                                        share|improve this answer












                                                        share|improve this answer



                                                        share|improve this answer










                                                        answered Mar 9 '16 at 20:50









                                                        MelBurslanMelBurslan

                                                        5,34611533




                                                        5,34611533



























                                                            draft saved

                                                            draft discarded
















































                                                            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.




                                                            draft saved


                                                            draft discarded














                                                            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





















































                                                            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







                                                            Popular posts from this blog

                                                            getting Checkpoint VPN SSL Network Extender working in the command lineHow to connect to CheckPoint VPN on Ubuntu 18.04LTS?Will the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayVPN SSL Network Extender in FirefoxLinux Checkpoint SNX tool configuration issuesCheck Point - Connect under Linux - snx + OTPSNX VPN Ububuntu 18.XXUsing Checkpoint VPN SSL Network Extender CLI with certificateVPN with network manager (nm-applet) is not workingWill the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayImport VPN config files to NetworkManager from command lineTrouble connecting to VPN using network-manager, while command line worksStart a VPN connection with PPTP protocol on command linestarting a docker service daemon breaks the vpn networkCan't connect to vpn with Network-managerVPN SSL Network Extender in FirefoxUsing Checkpoint VPN SSL Network Extender CLI with certificate

                                                            Cannot Extend partition with GParted The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election ResultsCan't increase partition size with GParted?GParted doesn't recognize the unallocated space after my current partitionWhat is the best way to add unallocated space located before to Ubuntu 12.04 partition with GParted live?I can't figure out how to extend my Arch home partition into free spaceGparted Linux Mint 18.1 issueTrying to extend but swap partition is showing as Unknown in Gparted, shows proper from fdiskRearrange partitions in gparted to extend a partitionUnable to extend partition even though unallocated space is next to it using GPartedAllocate free space to root partitiongparted: how to merge unallocated space with a partition

                                                            Marilyn Monroe Ny fiainany manokana | Jereo koa | Meny fitetezanafanitarana azy.