4

man -a <xyz> opens all the man pages one by one which contain xyz.
On my unix servers man -a <xyz> doesn't work.
Is there any alternative for this on unix?

EDIT:

I am on HP-UX. Following message :

hemantj [109]> man -a printf
Usage: man [-M path] [-T macro-package] [ section ] name ...
or: man -k keyword ...
or: man -f file ...
Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
Hemant
  • 6,834
  • 5
  • 38
  • 42
  • 2
    Why man -a doesn't work? Install a proper version of man. Try to debug it: strace man -a term 2> strace.out and echo $LANG Try to add your user to the man group. – Alex Bitek Aug 18 '10 at 16:03
  • What Unix are you exactly using: Solaris, HP-UX, AIX, *BSD? Also what does it mean "doesn't work": the `-a` option isn't recognized and man doesn't show anything or man shows only the first page? One more thing: could you give examples of `` just to be sure that there are multiple sections on that subject? – Cristian Ciupitu Sep 01 '10 at 02:26
  • @cristian: I just updated my original question. – Hemant Sep 10 '10 at 11:22
  • what happens when you run `man printf`? – Cristian Ciupitu Sep 10 '10 at 17:46
  • @Cristian: man printf opens man page for printf(1) – Hemant Sep 12 '10 at 08:25

3 Answers3

4

Does man -k work? If so, then:

man -k "$@" | cut -f1 -d' ' | xargs man

might do what you want

pjz
  • 403
  • 2
  • 6
2

Is apropos available on the system? It can be used to search for man pages.

With a quick one-liner, it can come close to the man -a behaviour

man `apropos -el apt | awk -F")" '{print $1}' | awk -F"(" '{print $2, $1}'`
theotherreceive
  • 2,076
  • 2
  • 16
  • 9
0

There are always emcas-based info pages:

$ info --apropos=man
$ info --apropos=info
Eimantas
  • 1,466
  • 3
  • 23
  • 30
  • 1
    Not necessarily (the Unix in question is HP-UX). Haven't used HP-UX since the late 90s so I don't have one handy, but GNU-based tools like `info(1)` aren't *globally* available unless we're talking about Linux. They certainly weren't available on SunOS and Solaris, and still aren't. You have to install the GNU tools separately, often by compiling them. – Alexios Jan 24 '12 at 01:42