cat will concatenate the contents of a number of files (if more than one is specified), and then print the contents to standard output
> will cause the output of a command (which would normally go to standard output) to be redirected to a file
You are entitled to your opinion. But you are not entitled to your own facts. -- Daniel Patrick Moynihan
without the second "cat" that you prefixed filenum2 with.
While you're on you may as well learn about redirection. That would be sending the output of a command into the input of a second command using these operators ">, >>, |".
Is a powerful feature of unix shell commands.
Redirection is handled by the command shell, but most command shells will treat
As though it had been written
Which is also equivalent to
In all 3 cases, filenum1 and filenum2 data will be concatenated and output to stdout, which has been redirected to go to a file named "cat". Redirection occurs out-of-band on most shell command lines, so the exact location of the redirection elements doesn't really matter. Although for sanity's sake, we usually do it either before or (more commonly) after the actual command arguments.
And now you know where the "cat" command got its name.
Some people, when well-known sources tell them that fire will burn them, don't put their hands in the fire.
Some people, being skeptical, will put their hands in the fire, get burned, and learn not to put their hands in the fire.
And some people, believing that they know better than well-known sources, will claim it's a lie, put their hands in the fire, and continue to scream it's a lie even as their hands burn down to charred stumps.
Doe, a deer, a female deer. Ray, a pockeful of sun. Me, a name, I call my tiny ad ...
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop