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?

  • What is the output of "alias man" or simply "alias"? – rbrtflr Jan 18 at 8:58
  • 1
    Is your man an alias? Check with type man or command -v man. – Kusalananda Jan 18 at 8:59
  • alias ll='ls -l --color=auto |grep '\'' -'\''' alias ls='ls --color=auto' – NeedHelp Jan 18 at 9:02
  • command -v man: /usr/bin/man – NeedHelp Jan 18 at 9:07
  • 1
    @jayooin It's setting the default locale to the standard C locale. There is nothing strange about that bit. – Kusalananda Jan 18 at 9:22
39

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 at 1: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. – mosvy Jan 19 at 4:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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