I’ll just mention coreutil’s cat very quickly, because it’s one of those omnipresent tools that everyone uses almost daily. I like to think it’s the first console tool people learn.
In spite of that, there are right ways and wrong ways to use it. The Internet is full of examples of misuses of cat, and what the right way should be.
cat really only does one thing: takes the contents of a file and directs it to the screen.
The beauty of it though, is when it’s used in combination with redirects, double redirects and so forth.
So it can function as a primitive copy tool, just by
cat oldtext.txt > newtext.txt
or tack one file on the end of another:
cat oldtext.txt >> newtext.txt
Dump text into a file from the keyboard with:
cat - > textfile.txt
The possibilities are endless, really. And maybe you didn’t know it, but cat does have a few flags you can use. Flag of the day is:
cat -n textfile.txt
which numbers the lines. Clever, eh?
If you want a better introduction, may I suggest this page, which has a quite a few nifty examples of what to do with cat.
Now then. Let’s move on, shall we?
P.S., rumor has it you can concatenate some audio or video files with cat. Who’d’ve thunk it?!