On SunOS man grep gives me the man page for the SunOS grep but grep --version says it's grep (GNU grep) 2.5. How do I get the man page for GNU grep?

link|improve this question

61% accept rate
feedback

3 Answers

up vote 1 down vote accepted

It sounds as if the machine has installed a new grep, but didn't update the man page. You have 4 options:

  1. goto the web and read the man page online
  2. try info grep instead. Often gnu packages come with info pages rather then man pages
  3. Goto to ftp://mirrors.kernel.org/gnu/grep/ or an other mirror site and download grep 2.5 (maybe 2.5.4?). Unpack it and you can install it, or in the docs dir you'll see a file grep.in.1. This is the man page. you can type:

    nroff -man grep.in.1 | more 
    

    to view it

  4. reinstall the package & documentation

link|improve this answer
feedback

It depends on where your man pages are but I think the -M flag or setting MANPATH would be your friends here.

alias gnuman='MANPATH=/path/to/gnu/man/root man'

or

alias gnuman='man -M /path/to/gnu/man/root'
link|improve this answer
And in fact it would be best to set MANPATH following PATH, so that command lookup and man page lookup give matching results. – Gilles Sep 24 '10 at 21:24
feedback

You should set the order of your MANPATH to match the order of PATH.

If your PATH is:

/usr/local/bin:/opt/local/bin:/home/myuser/bin:/usr/bin:/bin

set your MANPATH to:

/usr/local/man:/opt/local/man:/home/myuser/man:$MANPATH

(adjust as needed to reflect where your man pages actually are)

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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