7

At the bottom of man pcregrep, there is a message:

SEE ALSO

       pcrepattern(3), pcresyntax(3), pcretest(1).

However, when I try to view man pcresyntax I get:

$ man pcresyntax
No manual entry for pcresyntax
$ man 3 pcresyntax
No entry for pcresyntax in section 3 of the manual
$ man -k pcre
pcre-config          (1)  - program to return PCRE configuration
pcregrep             (1)  - a grep with Perl-compatible regular expressions
pcre_table           (5)  - format of Postfix PCRE tables
pcretest             (1)  - a program for testing Perl-compatible regular expressions

I tried yum info pcresyntax and even yum search pcresyntax and got nothing. At the suggestion of some comments posted below, I tried yum provides pcresyntax and yum whatprovides pcresyntax and got no results. (This box is running CentOS 6.6.)

What package includes the man page pcresyntax? More importantly, how can I find out what package includes a man page that I am missing?

(This is primarily for missing man pages that are mentioned in other man pages, rather than missing man pages for an installed command. In other words, man pages that are not obviously associated with a given command.)


NOTE: I work with Linux professionally and I am interested in broadly applicable answers, as well as answers specific to any of the major package managers. pcresyntax is just a specific example of a missing man page, not the end-all of my question.

Currently at work I primarily use yum, mostly on RHEL/CentOS 6, and I asked the title question rather than "where can I find the pcresyntax man page?" because I would like to know as much as possible about how to find and install missing man pages, for professional use both now (RHEL/CentOS) and in the future (Ubuntu/Debian, OpenSUSE, ...?)

Since asking this question I also found the Stack Overflow Regular Expressions FAQ which answered all my immediate questions about PCRE. ;)

  • Note that this isn't a duplicate of unix.stackexchange.com/q/79028/135943, because (a) I'm using CentOS 6.6, and more importantly because (b) I don't even know which package would include the appropriate man page; that's what I need to find out. – Wildcard Mar 15 '16 at 3:35
  • And did you try man 3 pcresyntax? – Faheem Mitha Mar 15 '16 at 3:52
  • @FaheemMitha, I did. Same result. In my first draft that comment was part of my question, but given that I'm asking how to fish rather than asking for a fish, I decided it belongs in comments as it is not directly relevant to the general question, for future readers. – Wildcard Mar 15 '16 at 4:00
  • @Wildcard what tools are available for a distribution strongly influences any answer this could have. You should specify the distribution, or at least the package management tool being used. Or else the answer is: "find what tool can search for package databases for files, and use that." – muru Mar 15 '16 at 6:17
  • @Wildcard All relevant information, including what distribution you are using, and what commands you tried to solve your issue, belongs to the question. At least in my opinion. – Faheem Mitha Mar 15 '16 at 6:53
4

For the system using RPM (yum) package manager, for instance (here) CentOS, use yum provides or yum whatprovides:

provides or whatprovides
              Is used to find out which package provides some feature or
              file. Just use a specific name or a file-glob-syntax wildcards
              to list the packages available or installed that provide that
              feature or file.

For pcresyntax, you can try:

yum whatprovides "*/pcresyntax"

From RHL documentation,

yum provides "*/file_name" is a useful way to find the packages that contain file_name.

Also visit How do I find which rpm package supplies a file I'm looking for?


For Debian/Ubuntu based system which use APT as default package-manager, there is apt-file (thanks @Gilles for pointing out) command which can do a job what you're looking for.

DESCRIPTION
       apt-file is a command line tool for searching files in packages for the APT package management system.

search Search in which package a file is included. A list of all packages containing the  pattern  pattern  is returned.

So, use apt-file search to find a package that includes a file you're looking for.


In another words, manpage is provided by files (usually from /usr/share/man) and possible duplicate of How to find out which (not installed) package a file belongs to?!

3

I found it like:

yum whatprovides '*/man3/pcresyntax*'

which on my CentOS 6.5 machine says it's in pcre-devel-7.8-6.el6

  • On Fedora: dnf whatprovides '*man3/pcresyntax*' ... or more liberally: dnf whatprovides '*man?/pcresyntax*' ... this takes a full 1m25s. (I finally found that getpeereid(3) comes from libbsd-devel yay!) – David Tonhofer May 1 at 15:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.