The reader continues with a nice post-script:
I think you book is quite a resource for introducing our people to UNIX. The Information Systems department here in our office has purchased 16 copies and distributed them to my colleagues.
First off, thanks for the kind words about my book. It distills more years of working with the Unix command line than I want to think about (and yet, even this morning I spent two hours working with grep and vi through an ssh connection to my server).
In terms of the cat command, it’s really one of the simpler commands available on the command line in Unix/Linux and just dumps out the contents of the specified file to standard output. So by default, cat .login, for example, dumps the contents of the “.login” file to the screen.
Once you start looking at file redirection in the shell, however, then you find out that cat becomes a considerably more powerful utility. For example, if I typed in cat .login > my.login then I would have accomplished essentially the same functionality as a file copy command (e.g., cp). But since cat can accept multiple filenames, a classic use of the command is to merge a bunch of files into a single output filename: cat a.txt b.txt c.txt d.txt > merged.txt.
Another quite common use of cat occurs in shell scripts, where it uses what us shell scripting programmers call here documents. These are a way to trick commands into thinking that you’re redirecting input from a file, as in wc < inputfile when there’s actually no file being fed to the command. The notation looks like this: << some end marker so if I wanted to find out what wc had to report about a paragraph of text, I could use:
cat << EOF | wc This is a paragraph of text that we want to learn more about, so we're feeding it to the 'wc' command through use of a here document. EOF
The result of this would be that wc would report how many lines, words and characters were found in its standard input, e.g., the short paragraph of text fed to it through use of the here document.
I hope that clears everything up! If not, please post a response and we can explore this topic further.