+ Reply to Thread
Results 1 to 8 of 8

Thread: man, apropos and whatis

  1. #1
    Join Date
    Aug 2009
    Location
    ~/
    Posts
    918
    Rep Power
    19

    man, apropos and whatis

    Thought I'd try my hand at a simple tutorial...

    One of the most important features of any Linux System is the Manual, otherwise known as the Man Pages.
    The Linux man pages is a project that documents the Linux Kernel and C Library interfaces employed by user programs.

    It's broken down into the following sections:

    1 General commands
    2 System calls
    3 C library functions
    4 Special files (usually devices, those found in /dev) and drivers
    5 File formats and conventions
    6 Games and screensavers
    7 Misc.
    8 System Administration commands and daemons


    All individual man pages follow a common layout:

    NAME
    The name of the command or function, with a one-line description of what it does.

    SYNOPSIS
    In the case of a command, you get a formal description of how to run it and what command line options it takes. For program functions, a list of the parameters the function takes and which header file contains its definition. For experienced users, this may be all the documentation they need.

    DESCRIPTION
    A textual description of the functioning of the command.

    EXAMPLES
    Some examples of common usage.

    SEE ALSO
    A list of related commands or functions.

    Other sections may be present, but these are not well standardized across man pages. Common examples include: OPTIONS, EXIT STATUS, ENVIRONMENT, KNOWN BUGS, FILES, AUTHOR, REPORTING BUGS, HISTORY and COPYRIGHT.


    When you run man, at the command line, the return is sent to standard out using "less" as the default browser. This is why it only displays a page worth of data and allows you to navigate through the rest of the output with the following:
    <enter key> - increment line by line through output
    <spacebar> - increment page by page
    <q> - quit

    In addition you will notice a number in parenthesis after the NAME like man(1), this number refers to the section mentioned above.

    To use man, at the command prompt type:
    man <command name>

    <command name> being the exact name of the command/function, for example...

    man man





    (If I could only give one command to a Linux newbie, it would be: man man)



    apropos (which is the same as man with the -k option (man -k)) searches through the man pages NAME and DESCRIPTION areas for occurrences of the keyword (pattern). This is especially useful when you can't remember the exact command name, but you know the partial name (NAME) or what it does (DESCRIPTION).

    The apropos output is sent directly to standard output without the benefit of a default browser such as less or more, so if the output is more then one screen you might want to pipe the output into less or more for convenient browsing.

    To use apropos, at the command prompt type:
    apropos <keyword>

    <keyword> being the name, partial name or partial description, for example...

    apropos manual
    or
    apropos manual | less



    The apropos command returns information from the whatis database, which is basically a database containing a command name and a one-line description which matches the NAME section of the Man Pages. This database is also used below with the whatis command.

    whatis is another piece in this documentation puzzle. Most descriptions say it searches the whatis database for a matching complete keyword. Basically, I think of it as a man page summary.

    whatis <keyword>

    <keyword> being the exact command name/function, for example...

    whatis man
    (the most perfect thing ever made, Ha! Ha! Ha! --sorry )



    These 3 commands (man, apropos and whatis) can help a new, as well as experienced, Linux user through most any command line problems that arise.
    In addition to these 3 commands, there is an alternate help system for the Linux user called... info, but that system is beyond the scope of this tutorial.

    Experiment with man, apropos and whatis as they are useful tools when navigating the command line.



    References:
    Man page - Wikipedia, the free encyclopedia
    Linux man-pages home
    apropos - Linux
    makewhatis(8): Create whatis database - Linux man page
    Linux MAN Pages - Linux Documentation with Search
    The GNU info Command

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Location
    Advertising world
    Posts
    Many

     
  3. #2
    Join Date
    Jul 2008
    Location
    Somewhere that is shorter to write than "In the gloomy shadows of my personal namespace"
    Posts
    10,725
    Blog Entries
    2
    Rep Power
    90

    Re: man, apropos and whatis

    Good to see you're writing tutorials - this one is great! Well explained and thorough, that's a +rep for sure
    Hey! Check out my new Toyota keyboaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

  4. #3
    Jordan Guest

    Re: man, apropos and whatis

    Very good tutorial! Man is a great and useful resource. Now, if we can only get people to start using it... +rep!

  5. #4
    Join Date
    Jul 2008
    Location
    Somewhere that is shorter to write than "In the gloomy shadows of my personal namespace"
    Posts
    10,725
    Blog Entries
    2
    Rep Power
    90

    Re: man, apropos and whatis

    I remember laughing hard after trying "whatis penis".... lol

    Code:
    Nothing appropriate
    Hey! Check out my new Toyota keyboaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

  6. #5
    Join Date
    Aug 2009
    Location
    ~/
    Posts
    918
    Rep Power
    19

    Re: man, apropos and whatis

    To finish up this tutorial, I'm adding a very brief description of the info command/documentation system mentioned above.

    The info command/function displays documentation saved in the info format which is typically created from a
    texinfo source (texinfo is a language) using the makeinfo command. texinfo was created to use a single document
    for online as well as printed documentation.

    The info command structure is as follows:

    info <filename>

    <filename> being the name of the info file (typically the name of a command)

    info man





    A wealth of information on the texinfo language and format is easily obtained via...

    info texinfo



    info, just like man, apropos and whatis are all great tools, let's make use of them.


    References:
    Using the Linux Info Command - To Get Info on a Linux Command | DataStronghold.com
    info - Linux Command - Unix Command

  7. #6
    Join Date
    Aug 2009
    Location
    ~/
    Posts
    918
    Rep Power
    19

    Re: man, apropos and whatis

    Quote Originally Posted by marwex89 View Post
    I remember laughing hard after trying "whatis penis".... lol

    Code:
    Nothing appropriate
    Ha! Ha! Ha!
    when I run that under my login I get this...

    Code:
    when used properly... inheritance is divided
    just kidding

  8. #7
    Join Date
    Jul 2006
    Posts
    16,491
    Blog Entries
    75
    Rep Power
    143

    Re: man, apropos and whatis

    Very nice. +rep
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  9. #8
    Jordan Guest

    Re: man, apropos and whatis

    Quote Originally Posted by debtboy View Post
    Ha! Ha! Ha!
    when I run that under my login I get this...

    Code:
    when used properly... inheritance is divided
    just kidding
    LOL, now that is funny!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts