When naming links to http://manpages.ubuntu.com (or other online sources for manual pages), I think man topic
(e.g., man ls
)--as suggested by andrewsomething's answer and others here--is the way to go.
However, occasionally there are multiple manpages with the same name (i.e., from different sections of the manual). When one actually runs the command man topic
, typically the page for topic
in the lowest-numbered section is shown, and typically this is desired. For example, running man chmod
shows the chmod
page from section 1 of the manual.
There are other manpages for chmod
, though. If I were to link to the manual page on the chmod
system call, I would not label that link man chmod
, because running man chmod
doesn't show that manual page. To show that manual page on the command line, one would run man 2 chmod
(since it's in page 2 of the manual).
Therefore, calling the link man 2 chmod
makes the most sense.
Note that while running man 1 chmod
shows the same page as man chmod
--the manual page for the chmod
command--I am not suggesting labeling links with the man N topic
syntax except when it would be necessary on the command line--i.e., except when man topic
would usually refer to a manpage different from the one desired.
This ambiguity can arise even when answering non-programming questions posted by novice users. The crontab
topic is such an instance:
man crontab
(equivalent toman 1 crontab
) shows the manual page for thecrontab
command.- The manual page for the
crontab
file format (i.e., how to write a crontab), which is perhaps more commonly cited and recommended, isman 5 crontab
.
###Syntactic/Historical Note and "Citation"
Syntactic/Historical Note and "Citation"
Traditionally among UNIX/*nix aficionados, manual pages are referred to as topic(n)
(e.g., ls(1)
, sudo(8)
). This notation is useful for brevity, and when everyone knows what that means because they have to be conversant with manpages to use the system (i.e, on Unix-like OSes that are way less user-friendly or GUI-oriented than Ubuntu), and on systems where hyperlinking often cannot be facilitated (e.g., email, usenet). I am not suggesting we adopt that notation widely here, though I wouldn't necessarily edit it out of someone else's post.
However, that notation is my motivation for my suggestion to specify the section of the manual when a different section would otherwise be inferred. I would cite the topic(n)
tradition as the source for the man n topic
idea I've put forward in this post.