0

When I type 'man read' on shell prompt it displays read shell command, how do I open documentation for read() C function. My question is not just for read applies to similar other functions like sleep()

I usually run to https://linux.die.net when it happens and refer documentation there, I am sure there would be way to get to right man page from shell prompt itself

Pras
  • 4,047
  • 10
  • 20
  • 2
    Distributions `alias` man in several ways. Generally around the `whatis` utility. In your case, look at the output of `whatis read`, and then you can easily select the man page you want with `man # read` (where `#` is the number corresponding to the wanted page). @chuckx explains well below. – David C. Rankin Jun 06 '18 at 03:31
  • @DavidC.Rankin Yes , it see 'whatis read' list section numbers for read along with brief description for each – Pras Jun 06 '18 at 03:38

1 Answers1

2
man <section #> <page>

From the man man page:

   The table below shows the section numbers of the manual followed by the types of pages they contain.

   1   Executable programs or shell commands
   2   System calls (functions provided by the kernel)
   3   Library calls (functions within program libraries)
   4   Special files (usually found in /dev)
   5   File formats and conventions eg /etc/passwd
   6   Games
   7   Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7)
   8   System administration commands (usually only for root)
   9   Kernel routines [Non standard]

To look up what sections exist for a given page, you can use the -k flag:

$ man -k ^sleep$
sleep (1)            - delay for a specified amount of time
sleep (3)            - sleep for a specified number of seconds
chuckx
  • 6,484
  • 1
  • 22
  • 23