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
Words you can keep
More from Urban Dictionary
(Ewokese) Freedom!
And dying in yo' bed many years from now, would ya be willing ta trade all da days from dis here day ta dat fo' one chance, just one chance, ta come back here as young men an' tell our enemies dat dey may take our lives but dey will never take our freedom ... YUB NUB!
yub nub by rotjrem November 4, 2010
Word of the Day on September 4, 2026
1. Meaning nasty, sexy, filthy. Popularized by Christina Aguilera.

2. Used usally as a close friend in hip-hop slang.
1. Wanna get dirrty
It's about time that I came to start the party Sweat drippin' over my body
Dancin' gettin' just a little naughty

2. Sup Dirrty? Haven't seen you in a while.
dirrty by Minty November 30, 2003
Word of the Day on September 3, 2026

Coyote Ugly

1. Place

The Bar came before the movie. It is an awesome bar where the girls know how to party and make you feel okay about giving up your money, drawers, bras, and dignity.

2. Movie

A story about a Jersey girl following her dreams, aided by working at this bar in New York.

3. Situation/Person/Decision

See other definitions - waking up next to someone so ugly you'd rather chew your arm off than wake them up.
1. Yo, Coyote Ugly is my favorite bar! I got whipped, stripped, drunk, and danced on the bar all before 7 o'clock!

2. Hey did you see Coyote Ugly? It actually has a plot!

3. Ugg I woke up to Coyote Ugly this morning!
Coyote Ugly by jerseycountry March 8, 2009
Word of the Day on September 2, 2026

Literally 1984 

Used in response for when someone promotes/advocates an event or idea that is perceived to support "too much" authority and/or government control.

Often used jokingly as a over-exaggeration in political talk.

Can also be used in response to a ban or mute in a forum site or online chat.
Steve: I think that the government should regulate businesses more
Bob: Literally 1984!

--User1 has been permantly banned--
User2: You cant ban my friend like that! Literally 1984!
Literally 1984 by ke1 July 7, 2021
Word of the Day on September 1, 2026

Back when I lived in upstate new york 

A meaningless, unimpressive, self-serving introduction. An indicator that the story about to be shared will be pointless and dumb.
Back when I lived in upstate new york, I also had to park on the street - on two occasions, we got enough snow, mixed with just the right plowing, that my car was lifted off the ground from so much snow being jammed underneath it.
Word of the Day on August 31, 2026
Acronym, meaning Too Long Didn't Understand
Similar to TLDR
Sister: This meeting was to discuss the rough draft of my essay, where we discussed the subsidiary questions I added in my rough draft. We also discussed the relationship between my main title and the real-life situations I chose to use in my essay. We discussed the structure of my essay as well, specifically the Math AOK section and how it relates to the contradiction of the title. This second meeting was particularly helpful in discussing the implications of my essay claims and how to apply the title across various areas of knowledge. There were many sections of the essay that could have been cut down in wordiness and the ways of knowing required further and more in-depth analysis.

Me: Woah! TLDU!
TLDU by L-Evans January 14, 2019
Word of the Day on August 30, 2026
Next