Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

3 Answers 3

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

share|improve this answer

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)

share|improve this answer

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'
share|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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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