Skip to main content

Mastering cat 

A fictitious (literally, it's not a real book) book about mastering the UNIX/Linux 'cat' command. "Written" by Shlomi Fish, the acclaimed author of 'Mastering rm', and 'Mastering mv'.
O'Reilly Net: Hi Shlomi!

Shlomi Fish: Hi!

O'Reilly Net: So, what has motivated you to write the book?

Shlomi Fish: Well, I realised people use cat so often that they don't take the time to fully investigate it and learn it. For example, many people I worked with believed that cat can only be used to output one file at a time. So to output several files they used something like:

(cat file1.txt ; cat file2.txt ; cat file3.txt) | command

The horror! cat accepts several files as arguments. So you can write it as:

cat file1.txt file2.txt file3.txt | command

This has motivated me to write the book, to make people fully understand the command.

O'Reilly Net: Isn't mastering cat supposed to be quite easy? Does it really necessitates its own book?

Shlomi Fish: Hell no! Mastering cat is not easy at all. In fact, mastering cat is almost as difficult as herding cats.

For example, one case where I found that people truly underestimate the power of cat is in the prefixing a line example. You can do that with:

echo "This would be the first line" | cat - myfile.txt > myfile.txt.new
mv -f myfile.txt.new myfile.txt

But people do not realize that and instead opted to use sed, awk, or even perl (!). It can be taken further, of course. If the prefix is already in its own file, you can simply use cat prefix.txt myfile.txt

Of course, if you want to append the same text to both the start and the end of a file, you can't do that with cat - myfile.txt -. It simply doesn't work that way. So, I end up explaining a lot about UNIX pipeline concepts in the book.

O'Reilly Net: So what else does your book cover?

Well, I cover many things there. Among them are:

1. History of the cat command.

2. Differences between the various cat implementations. (GNU, the BSDs, System V, etc.)

3. cat equivalents in other operating systems (DOS, Win32, VMS, OS/390, etc.)

4. Overview of the GNU cat codebase (for programmers).

I'm also focusing on the various cat flags, which aid in its interactive use. For example the -E/--show-ends flag, that places dollar signs at the end of the lines.

Except for that I'm also covering dog which is a program that provides a superset of the cat program. I should also mention mouse which aimed to provide an even greater superset, and was never released. Rumors say some parts of it are based on code of the leaked Windows 2000 sources.

O'Reilly Net: Your book seems bound to be popular. (for some values of popularity) What can we expect from you next?

Shlomi Fish: Well, I hope many people will buy the book, or read it online so they'll be educated about cat. If you like "Mastering cat", look forward to my next book - "Mastering echo". I expect it to be published next fall.
Mastering cat by ivantis May 17, 2009
Mastering cat mug front
Get the Mastering cat mug.
See more merch
A small piece of information. Derived from the word ken, used often in the scottish language and is synonymous with knowledge.
Person 1: "Hey I don't get this shit. How do you solve this problem?"
Person 2: "I got that one. Give me some kenlets on this assignment and I'll help you w/ that one."
kenlet by Norma Y. October 8, 2005
Word of the Day on July 13, 2026

I mean I guess bro

a word of expression to when you give up on comprehending someone's words of ignorance, stupidity, absurdity or are too exhausted to formulate a proper response.

Commonly seen in TikTok comment sections in replies to lazy attempts at humor, overconfidentally incorrect statement, or an over-the-top comment or when someone completely misses the mark on something.
"actually... incorrect statement, hope this helps!"
"I mean I guess bro"
Word of the Day on July 12, 2026

abandonware 

n. software that is no longer sold or supported by the original publisher / developer, often found as free downloads on the internet because it cannot be obtained elsewhere. Not legal, but often seen as morally acceptable because the company that made it is no longer selling the title, nor releasing it as freeware, therefore abandonware is "keeping the game alive", so to speak.
Doom II is not abandonware because id still sells it, while The Incredible Machine is not sold, therefore is abandonware.
abandonware by Spoom October 24, 2003
Word of the Day on July 11, 2026

Foot prisons 

Socks. Annoying, sweat-causing, non-barefoot enducing, everyday socks.
The first thing I do when I take off my shoes, is rip off the foot prisons I had to wear inside them. That's why I prefer flip flops, even in winter!
Foot prisons by Jackalope Hunter December 13, 2022
Word of the Day on July 10, 2026

cornholio 

Ruler of Lake Titicaca. Rumored to have a bunghole that gets very angry if it does not receive toilet paper. Cornholio the Great is often seen walking around with his shirt over his head and his hands in the air, chanting songs about his power, and his bunghole.
"I am Cornholio! You do not want to face the wrath of my bunghole, for I need TP!"
Butthead: Shut up, Beavis! (uh huh huh huh)
Beavis: Um, okay. (heh heh heh heh).
cornholio by AYB July 20, 2003
Word of the Day on July 9, 2026

mickey mousing

In a movie, when the music is syncronized perfectly with the action, just like a mickey mouse cartoon.
Mickey mousing is used in the shower scene of Psycho
Word of the Day on July 8, 2026