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 [?
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 [?
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.
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
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
[ortestis a builtin it also exists as a separate command (/bin/[).>is a redirection operator and is part of a shell implementation (does not exist as a separate command). Info about redirection operators can be consulted from the shell man page (e.g, bash, zsh, ksh, etc.). – Paulo Tomé Mar 30 '20 at 18:08>from with my terminal/command line? – Honey Mar 30 '20 at 18:09>is built in tobashor whatever shell I'm using.[is built into what? – Honey Mar 30 '20 at 18:12[(or its aliastest) has two implementations; it exists as a shell builtin and as a separate command. Whereas the redirection operators only exist as a builtin command. – Paulo Tomé Mar 30 '20 at 18:22