while this is happening on my fedora 30 branched system, i'm fairly sure the question corresponds to a regular system with man pages.
how does one establish an alias for an existing man page if it's not done in the "obvious" way? as an example, currently on my system, under /usr/share/man/man5, i have these two entries:
-rw-r--r--. 1 root root 4807 Feb 1 15:19 utmp.5.gz -rw-r--r--. 1 root root 36 Feb 1 15:19 utmpx.5.gz
predictably, both of the following generate the same man page:
$ man 5 utmp $ man 5 utmpx
because the smaller of the two files is simply a reference to the other:
$ gunzip -c utmpx.5.gz .so man5/utmp.5 $
however, i recently installed the package "containers-common", which installed (among other things) the single man page file under /usr/share/man/man5:
/usr/share/man/man5/containers-storage.conf.5.gz
with that installed, both of the following commands work fine and generate the same output:
$ man 5 containers-storage.conf $ man 5 storage.conf
but i see no "shortcut" file in that directory to support the second form, so i'm assuming there is some other mechanism by which this can be done, i just don't know what it is. thoughts?
rday
Robert P. J. Day wrote:
however, i recently installed the package "containers-common", which installed (among other things) the single man page file under /usr/share/man/man5:
/usr/share/man/man5/containers-storage.conf.5.gz
with that installed, both of the following commands work fine and generate the same output:
$ man 5 containers-storage.conf $ man 5 storage.conf
but i see no "shortcut" file in that directory to support the second form, so i'm assuming there is some other mechanism by which this can be done, i just don't know what it is. thoughts?
AFAIK, man finds 'storage.conf' because it is the title of the man page. So it's not actually an alias.
$ zcat /usr/share/man/man5/containers-storage.conf.5.gz | head -n1 .TH "storage.conf" "5" " Container Storage Configuration File" "Dan Walsh" "May 2017"
On Tue, 26 Mar 2019, Todd Zullinger wrote:
Robert P. J. Day wrote:
however, i recently installed the package "containers-common", which installed (among other things) the single man page file under /usr/share/man/man5:
/usr/share/man/man5/containers-storage.conf.5.gz
with that installed, both of the following commands work fine and generate the same output:
$ man 5 containers-storage.conf $ man 5 storage.conf
but i see no "shortcut" file in that directory to support the second form, so i'm assuming there is some other mechanism by which this can be done, i just don't know what it is. thoughts?
AFAIK, man finds 'storage.conf' because it is the title of the man page. So it's not actually an alias.
$ zcat /usr/share/man/man5/containers-storage.conf.5.gz | head -n1 .TH "storage.conf" "5" " Container Storage Configuration File" "Dan Walsh" "May 2017"
i saw that as the included title and actually thought, "could it just be picking up the title in the page itself?" and i thought, "nah, it must be something more elegant." so that's it? huh.
rday
Robert P. J. Day wrote:
On Tue, 26 Mar 2019, Todd Zullinger wrote:
AFAIK, man finds 'storage.conf' because it is the title of the man page. So it's not actually an alias.
$ zcat /usr/share/man/man5/containers-storage.conf.5.gz | head -n1 .TH "storage.conf" "5" " Container Storage Configuration File" "Dan Walsh" "May 2017"
i saw that as the included title and actually thought, "could it just be picking up the title in the page itself?" and i thought, "nah, it must be something more elegant." so that's it? huh.
I can't say I know the full rules used by the man command, but the title and the name fields are indexed by mandb and then used when you pass a page to the man command.
You can use the --debug (-d) option to man to get a lot more detail about how it finds a page, usually combined with the --where (-w) option to simply show the location of the man page source.
Something like:
man -d -w 5 storage.conf |& less
I always understood that “man” ran a script which basically ran “nroff -man”
On 26 Mar 2019, at 18:03, Todd Zullinger tmz@pobox.com wrote:
Robert P. J. Day wrote:
On Tue, 26 Mar 2019, Todd Zullinger wrote: AFAIK, man finds 'storage.conf' because it is the title of the man page. So it's not actually an alias.
$ zcat /usr/share/man/man5/containers-storage.conf.5.gz | head -n1 .TH "storage.conf" "5" " Container Storage Configuration File" "Dan Walsh" "May 2017"
i saw that as the included title and actually thought, "could it just be picking up the title in the page itself?" and i thought, "nah, it must be something more elegant." so that's it? huh.
I can't say I know the full rules used by the man command, but the title and the name fields are indexed by mandb and then used when you pass a page to the man command.
You can use the --debug (-d) option to man to get a lot more detail about how it finds a page, usually combined with the --where (-w) option to simply show the location of the man page source.
Something like:
man -d -w 5 storage.conf |& less
-- Todd _______________________________________________ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-leave@lists.fedoraproject.org Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
On Tue, 26 Mar 2019 06:57:52 -0400 (EDT) "Robert P. J. Day" rpjday@crashcourse.ca wrote:
how does one establish an alias for an existing man page if it's not done in the "obvious" way? as an example, currently on my system, under /usr/share/man/man5, i have these two entries:
-rw-r--r--. 1 root root 4807 Feb 1 15:19 utmp.5.gz -rw-r--r--. 1 root root 36 Feb 1 15:19 utmpx.5.gz
predictably, both of the following generate the same man page:
$ man 5 utmp $ man 5 utmpx
because the smaller of the two files is simply a reference to the other:
$ gunzip -c utmpx.5.gz .so man5/utmp.5 $ however, i recently installed the package "containers-common", which installed (among other things) the single man page file under /usr/share/man/man5:
/usr/share/man/man5/containers-storage.conf.5.gz
with that installed, both of the following commands work fine and generate the same output:
$ man 5 containers-storage.conf $ man 5 storage.conf
but i see no "shortcut" file in that directory to support the second form, so i'm assuming there is some other mechanism by which this can be done, i just don't know what it is. thoughts?
I'm not sure, but the expansion of the file containers-storage.conf.5.gz has it defined as .TH "storage.conf" "5" " Container Storage Configuration File" "Dan Walsh" "May 2017" I am guessing that man uses both the definitions and the actual directory listing in combination to determine the presence of a man file.