Difference between 'apropos *' and 'apropos .'

0

OpenSUSE 12.01, KDE, kernel 3.1.9-1.4-default

Trying to get all man pages. Basically the answer is apropos . or man -k .. Why does apropos \* only returns about 300 man pages while apropos . returns close to 60,000 and in a lot less time? I get that the former is doing a search and compare op and therefor is slower while the latter just belched out whatever it found. However, why does \* becomes a search operation while ., also a regexp, becomes a listing operation?

PS: apparently I had to type \\\* to get \*, interesting.

VNElectric

Posted 2012-05-10T15:40:23.267

Reputation: 1

Answers

1

To begin with, try the following commands in a terminal:

echo *
echo \*
echo '*'

The unquoted/unescaped asterisk will be expanded before apropos gets it, and will thus do as many searches as you have files in the current directory.

apropos '*' is an invalid regex search; you'd need apropos '.*' ("match any character 0 or more times"), but that will give the same result as just apropos ..

Daniel Andersson

Posted 2012-05-10T15:40:23.267

Reputation: 20 465

Cool, I struggled with that for a while with my first bash script. Completely forgot. Thanks, – VNElectric – 2012-05-10T15:55:47.567