2

I just did man [ and it opened the manual.

Then I tried doing man > but I get this error:

-bash: syntax error near unexpected token `newline'

How is > different from [?

Honey
  • 124

1 Answers1

1

As you have seen, the command man > will invoke redirection rather than give you a man page for it.

Since > is a shell operator, you need to go to the man page for your shell, for example if you run bash you can use man bash and look for the section on 'REDIRECTION'. All the shell redirection operators will be listed there; they don't have their own man pages.

ilkkachu
  • 138,973
user1794469
  • 4,067
  • 1
  • 26
  • 42
  • I hit cmmd + f and searched for REDIRECTION but wasn't able to find it. The search only worked if REDIRECTION was visible. Is that also happening for you? Is that expected or that's a bug? – Honey Mar 30 '20 at 19:07
  • My MANPAGER is less so I use forward slash / which will accept regex. For many distros this is the default MANPAGER but you can change it if you like. – user1794469 Mar 30 '20 at 19:58