Linux Manual Pages development
 help / color / mirror / Atom feed
From: Alejandro Colomar <alx@kernel.org>
To: linux-man@vger.kernel.org, man-db-devel@nongnu.org
Subject: Spaces, underscores, and dashes in manual page names when using man(1)
Date: Fri, 11 Sep 2026 02:13:55 +0200	[thread overview]
Message-ID: <aqNFJA3aXiitHCyz@devuan> (raw)

[-- Attachment #1: Type: text/plain, Size: 3152 bytes --]

Hi Colin,

I find this quite intriguing.  Using a space in place of an underscore
in the name of a manual page seems to work, but using two seems to not
work.  This seems inconsistent.  I'd say this should either work for any
and/or all spaces, or for none of them.

	$ man -aw proc_sys_fs_inotify
	/usr/local/man/man5/proc_sys_fs_inotify.5
	$ man -aw proc sys_fs_inotify
	/usr/local/man/man5/proc_sys_fs_inotify.5
	$ man -aw proc_sys fs_inotify
	/usr/local/man/man5/proc_sys_fs_inotify.5
	$ man -aw proc_sys_fs inotify
	/usr/local/man/man5/proc_sys_fs_inotify.5
	$ man -aw proc sys fs_inotify
	/usr/local/man/man5/proc_sys.5
	/usr/share/man/man5/proc_sys.5.gz
	No manual entry for fs_inotify
	$ man -aw proc sys_fs inotify
	/usr/local/man/man5/proc_sys_fs.5
	/usr/share/man/man5/proc_sys_fs.5.gz
	/usr/local/man/man7/inotify.7
	/usr/share/man/man7/inotify.7.gz
	$ man -aw proc_sys fs inotify
	/usr/local/man/man5/proc_sys_fs.5
	/usr/share/man/man5/proc_sys_fs.5.gz
	/usr/local/man/man7/inotify.7
	/usr/share/man/man7/inotify.7.gz
	$ man -aw proc sys fs inotify
	/usr/local/man/man5/proc_sys.5
	/usr/share/man/man5/proc_sys.5.gz
	/usr/local/share/man/man5/filesystems.5
	/usr/share/man/man5/filesystems.5.gz
	/usr/local/man/man7/inotify.7
	/usr/share/man/man7/inotify.7.gz

The same thing happens with dashes:

	$ man -aw user-session-keyring
	/usr/local/man/man7/user-session-keyring.7
	/usr/share/man/man7/user-session-keyring.7.gz
	$ man -aw user session-keyring
	/usr/local/man/man7/user-session-keyring.7
	/usr/share/man/man7/user-session-keyring.7.gz
	$ man -aw user-session keyring
	/usr/local/man/man7/user-session-keyring.7
	/usr/share/man/man7/user-session-keyring.7.gz
	$ man -aw user session keyring
	No manual entry for user
	/usr/local/man/man7/session-keyring.7
	/usr/share/man/man7/session-keyring.7.gz

And also with combinations:

	alx@devuan:~/src/linux/man-pages/man-pages/contrib$ man -aw proc_sysrq-trigger
	/usr/local/man/man5/proc_sysrq-trigger.5
	/usr/share/man/man5/proc_sysrq-trigger.5.gz
	alx@devuan:~/src/linux/man-pages/man-pages/contrib$ man -aw proc sysrq-trigger
	/usr/local/man/man5/proc_sysrq-trigger.5
	/usr/share/man/man5/proc_sysrq-trigger.5.gz
	alx@devuan:~/src/linux/man-pages/man-pages/contrib$ man -aw proc_sysrq trigger
	/usr/local/man/man5/proc_sysrq-trigger.5
	/usr/share/man/man5/proc_sysrq-trigger.5.gz
	alx@devuan:~/src/linux/man-pages/man-pages/contrib$ man -aw proc sysrq trigger
	/usr/local/man/man5/proc.5
	/usr/share/man/man5/proc.5.gz
	No manual entry for sysrq
	No manual entry for trigger

The (one) space is well-known to work, and helps find documentation for
things like 'git diff' as 'man git diff', so that behavior should stay.
I suspect we also want to make it work for more than one space, though.
Or are there any important issues with handling more than one space?

Here's the version of man-db I have installed (Devuan unstable):

	$ dpkg -l man-db | tail -n1
	ii  man-db   2.13.1-1   amd64          tools for reading manual pages


Have a lovely night!
Alex

-- 
<https://www.alejandro-colomar.es>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

                 reply	other threads:[~2026-09-11  0:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aqNFJA3aXiitHCyz@devuan \
    --to=alx@kernel.org \
    --cc=linux-man@vger.kernel.org \
    --cc=man-db-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox