man -k (how to use correctly)

This is a discussion on man -k (how to use correctly) within the Linux Programming forums, part of the Platform Specific Boards category; hi all, I know this isn't programming directly but will help indirectly to a program I am writing. I'm not ...

  1. #1
    cus
    cus is offline
    Registered User
    Join Date
    Jan 2009
    Posts
    66

    man -k (how to use correctly)

    hi all, I know this isn't programming directly but will help indirectly to a program I am writing.
    I'm not sure if I am using the manual pages correctly from the terminal. From notes from a lecture the professor has said that a 'man -k uid' - will bring up info such as this:

    Code:
    struct passwd *getpwnam(const char *name);
           struct passwd *getpwuid(uid_t uid);
           int getpwnam_r(const char *name, struct passwd *pwbuf,
                   char *buf, size_t buflen, struct passwd **pwbufp);
           int getpwuid_r(uid_t uid, struct passwd *pwbuf,
                   char *buf, size_t buflen, struct passwd **pwbufp);
    The lecturer says that you can then exit the screen by pressing 'Q' for quit.
    However, when ever i do it all i get is:
    Code:
    cwaves (6x)          - languid sinusoidal colors
    dbus-uuidgen (1)     - Utility to generate UUIDs
    fdutilsconfig (8)    - configure the suid bit of fdmount
    findfs (8)           - Find a filesystem by label or UUID
    Gnome2::Druid (3pm)  - (unknown subject)
    Gnome2::DruidPage (3pm) - (unknown subject)
    Gnome2::DruidPageEdge (3pm) - (unknown subject)
    Gnome2::DruidPageStandard (3pm) - (unknown subject)
    Gnome2::UIDefs (3pm) - (unknown subject)
    LDP (7)              - Intro to the Linux Documentation Project, with help, guides and documents
    mdoc (7)             - quick reference guide for the -mdoc macro package
    pam_loginuid (8)     - Record user's login uid to the process attribute
    uuidd (8)            - UUID generation daemon
    uuidgen (1)          - command-line utility to create a new UUID value
    vol_id (8)           - probe filesystem type and read label and uuid
    Why isn't the synopsis and explanation of uid displayed? Or am I doing this completely wrong?

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Because man -k means search for the keyword and list all the relevant topics, about the same as the "apropos" command.

    Quote Originally Posted by man 1 man
    -k direct man to search the whatis databases for any entry matching the
    given keyword. This is useful when the precise topic is unknown; it
    reports the topics that have to do with the given keywords, according
    to their whatis descriptions. Output will be sent to the user's
    PAGER. This switch is automatically enabled if man is invoked as apro-
    pos.
    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    So -k gives you all the man pages that reference uid. You can then read those man pages (with just plain man) to see what they have to say. man -K (notice the difference) searches inside the man pages (and at least in my version of Mac OS here, it asks me, for each one it finds, whether I want to read it).

    You can get information about man by typing "man --help".

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. handling man (groff) pages in C
    By MK27 in forum Linux Programming
    Replies: 3
    Last Post: 09-12-2008, 01:46 PM
  2. casting - pointer to pointer
    By terminator in forum C Programming
    Replies: 56
    Last Post: 04-23-2008, 01:54 AM
  3. we of the cage
    By mithrandir in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 08-21-2002, 11:14 AM
  4. Gender Humour Thread
    By stevey in forum A Brief History of Cprogramming.com
    Replies: 39
    Last Post: 06-01-2002, 02:12 PM
  5. Replies: 2
    Last Post: 03-11-2002, 09:15 PM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21