I'm running CentOS 7.0 build 1503. I'm trying to search for commands I don't know the name of by searching the man descriptions for multiple keywords using AND (e.g. search for a command containing the both words "create" and "group" in the description).
So I came across the command apropos (which is an alias for man -k). The default behaviour when given multiple keywords is to return any command matching any of the keywords, which isn't what I want. According to the man page the option -a specifies using AND, to return matches only when all words match.
But this isn't what I'm seeing in practice, so I need some help here - e.g. using Centos 7, if I do:
apropos create user
I see a huge list of commands, seemingly matching any command with create or user in the description, as expected. Noting the list includes an entry for the command 'useradd (8) - create a new user...'.
If I do:
apropos -a create user
I only get 2 commands (environ and open). This is what I'm confused by - I would expect it to return the command 'useradd (8) - create a new user', because i can see from the previous search that command does contain those words in the description. Also the 2 returned commands don't obviously seem to be anything about creating users. What am I doing wrong? I'm sure it's something embarrassingly obvious, for that I apologise in advance.