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
well known from south park
rednecks get angrry that future folk took there jobs so they yell
They took ouare jerbs!
Them future folk took ouare jerbs!
jerb by Jimberley Kim April 7, 2005
Word of the Day on May 22, 2026
An Irish phrase meaning shit, derived from ass
(Not to be confused with the literal description of one's buttocks)
"Did you hear the song Aylek$ dropped?"
"Hardly. Her music is absolute cheeks."

"My boyfriend say LaFlame is cheeks."
"Tell your boyfriend I said it's his mixtape that's cheeks."
Cheeks by thecartisan April 26, 2020
Word of the Day on May 21, 2026

sans sheriff 

Lawless use of fonts or typography, with no regard to aesthetics or legibility
I'm putting this CV straight in the bin. Written totally sans sheriff.
sans sheriff by Jamarley July 3, 2019
Word of the Day on May 20, 2026

Breadhead 

Someone who is addicted to obtaining money and building wealth. A money addict and fanatic. Breadheads often work more than one full-time job, and some even participate in illicit activities to "obtain the bread".
A breadhead is like a crackhead, but for money instead of crack.
Breadhead by 🅱️ U S 3 4 8 March 30, 2022
Word of the Day on May 19, 2026

Stink lines

As seen in illustrations or cartoons: Wavy, vertical lines rising above a person, place or thing. Denotes a foul odor.
"You didn't put enough stink lines on your picture of the teacher."
Stink lines by Athene Airheart March 14, 2004
Word of the Day on May 18, 2026

schmegegge 

Yiddish slang word meaning bullshit, baloney, hogwash, nonsense, crock of shit or hot air.
I don't buy the schmegegge about Morty sleeping with Moira.
His version of the story was pure schmegegge.
The whole schmegegge was made up to get Liz a little bit of attention.
schmegegge by budsbabe February 1, 2008
Word of the Day on May 16, 2026