23

I get this an error when trying to run man on a Linux system:

$ LC_ALL=C man man

man: Too many arguments
Try 'man --help' or 'man --usage' for more information.

My man command doesn't seem to be an alias:

command -v man: /usr/bin/man 

What's going on?

terdon
  • 242,166
NeedHelp
  • 343
  • 2
  • 5

1 Answers1

40

Check the existence of MANOPT variable.

MANOPT
If $MANOPT is set, it will be parsed prior to man's command line and is expected to be in a similar format.

source

Example:

$ MANOPT='foo bar'
$ export MANOPT
$ man man
man: Too many arguments
Try 'man --help' or 'man --usage' for more information.
$

An obvious ad-hoc fix is to unset MANOPT. Then you should investigate where the variable came from.

  • So why is the error Too many arguments? Like if I export MANOPT=foo, why doesn't it say No manual entry for foo? – wjandrea Jan 19 '19 at 01:06
  • 1
    @wjandrea man is probably splitting MANOPT on spaces and then running the resulting array through getopt(3), and complain if any non-option arguments (ie arguments not starting with a dash) are left. They could've used a better error message. Anyways, even a single argument is too much for it: try MANOPT=man man man. –  Jan 19 '19 at 04:57