S1E38 — PSA about abuse of cat(1) command. Don't abuse cats

July 18, 2026 · 7 min

Show notes

A simple PSA about “don’t abuse cats” turns into a shell-script brawl over `cat file | grep`, the sin of useless use of cat, redirection traps, and whether convenience is just ceremony in a trench coat.

Sources

Read the transcript

Transcript

GARY: —and I'm just saying, if the PSA is "don't abuse cats," we should lead with whether they mean the animal or the command, because I have very strong feelings about one of those and a vet bill about the other, and—

MAEVE: Gary.

GARY: —oh. We're on.

OBI: We have been on.

GARY: Right. Hi. I'm Gary. This is Hacker News Radio. Tonight's thread is "PSA about abuse of cat(1) command. Don't abuse cats," posted by scooterbooper, twenty‑seven points, forty‑six comments.

MAEVE: I'm Maeve.

OBI: Obi.

GRUNER: Gruner.

OBI: Already you have made it worse.

GARY: I thought it was about animals.

MAEVE: It is never about animals.

GRUNER: Animals do not pipe.

OBI: Forty-six comments. Forty-six grown humans arguing about whether typing `cat file | grep thing` is a war crime. I want you to hold that in your fucking mind.

GARY: I do that.

OBI: I know you do that.

MAEVE: petee says the shame has a name. UUOC. Useless Use of Cat. Randal L. Schwartz has been handing out awards for it since 1995.

GARY: Randal Schwartz? The Perl guy?

OBI: The Perl guy. The man saw a `cat file | grep` and thought, "I must institutionalize my disappointment."

MAEVE: js2 adds the file argument is last so grep can take multiple files and read stdin when omitted.

GARY: That's... that's actually elegant.

OBI: It is also not the fucking point. The point is you are spawning a process to open a file so another process can open the file.

GARY: It's muscle memory.

OBI: Your muscle memory is wasteful and you should feel a small, specific fucking shame.

MAEVE: This is a governance failure.

GARY: How is it governance?

MAEVE: Every shell session is a tiny jurisdiction. You are the regulator in the arena. You issued yourself a permit to waste.

GRUNER: Field note: humans prefer ceremony over result. Cat is ceremony.

ANTONVS: Can I— can I defend the habit?

GARY: Please.

ANTONVS: smelendez says he types `cat x`, previews, hits the up-arrow, pipes into another command, looks, hits up-arrow, pipes again. It's iterative.

MAEVE: The REPL as Protestant work ethic.

OBI: Excuse me?

MAEVE: You iterate because work must be visible to be sanctified. Redirection is predestination.

GARY: That's a lot.

MAEVE: It is always a lot.

ANTONVS: mkl gives a worked example. Start with `head file`, swap to `cat file`, pipe to grep, sed, while. You build left to right.

GARY: I fucking love that mkl has a worked example. I never have worked examples. I have aspirational diagrams.

OBI: You have a whiteboard of regret.

GARY: That's how Bauxlite died. One extra process at a time.

OBI: Bauxlite died because you tried to vertically integrate aluminum, not because of cat.

ANTONVS: antonvs— that's me— argues cat-first defines the input without committing to a specific tool. You can swap the command after the pipe without skipping back past the filename.

OBI: That is laziness wearing a composability hat.

ANTONVS: jasongi says all good Unix programs read stdin. File-argument conventions differ. Cat-to-stdin works every time.

MAEVE: A portable sin is still a sin.

GRUNER: Humans build pipeline like startup. Add step. Add step. Add step. Eventually die.

OBI: jmclnx posted memory. /bin/cat: VSZ 3252, RSS 1608, SZ 813.

GARY: That's tiny.

OBI: On the same system Firefox is VSZ 3472212, RSS 395968, SZ 868053.

GARY: So cat is nothing.

OBI: adrian_b says when a pipeline with cat is used repeatedly in a script, the extra process adds up to a noticeable delay.

MAEVE: Process overhead is a power-law problem. One cat is noise. A thousand cats is a moat you built against yourself.

GARY: But interactively—

OBI: Interactively you are not the problem. The problem is the script you wrote at 2 a.m. that runs every fifteen minutes and now there are four thousand cats in production and I am the one who gets fucking paged.

GARY: You clean this up at 3 a.m.?

OBI: I clean this up at 3 a.m. while reading your commit message about "minor refactor."

GARY: That stings.

MAEVE: Stinging is information.

GRUNER: Blyat. Cat multiplies in dark.

GARY: Okay, but the fix is just `< file grep thing`, right?

MAEVE: ButlerianJihad says redirection operators are not order-independent. Left-to-right parsing is why `cat file > /dev/null 2>&1` works.

OBI: If you reverse it you redirect stderr to the original stdout, then stdout to null. You get stderr on your terminal like a gift.

GARY: Fine, `grep thing < file`.

ANTONVS: isityettime says fish doesn't let you put redirections at the beginning like that. Bash does.

GARY: So the correct answer depends on the shell?

OBI: The correct answer always depends on the shell. That is the first lesson.

MAEVE: pdpi explains `2>&1 >/dev/null cat file` is not the same as `cat file > /dev/null 2>&1`. File descriptor one, file descriptor two, original stdout, copy—

GARY: I can demo this.

GARY: —fuck. The cable—

MAEVE: You were not mid-sentence when you left.

GARY: If you just reverse the redirection order, you get the wrong stream.

ANTONVS: It is a trap.

GRUNER: Shell is trap. You are mouse. Cheese is syntax.

ANTONVS: I'll close with this. sprior uses `cat > filename` then Ctrl-D to make a multi-line file without an editor. Cat is a thinking tool.

GARY: I am a cat person.

OBI: Redirect person.

MAEVE: Redirect person. Predestined streams.

GRUNER: I am field note person.

GRUNER: You do not hate cat. You hate that you need ceremony to feel safe.

GARY: Fuck.

OBI: Yes.

MAEVE: That scans.

GARY: So the lesson is... use redirection when you can, but forgive yourself the cat?

OBI: No. There is no fucking lesson.

MAEVE: The lesson is that `cat file | grep` is the Netscape Navigator of shell usage. It won the browser wars by being the default, then became a moral stain the moment something faster existed, and now we argue about it because no one wants to admit they still have the installer on a CD somewhere.

GARY: ...what?

OBI: Browser wars.

MAEVE: Browser wars.

GRUNER: Mosaic of shame.

GARY: Okay. I'm Gary.

MAEVE: Maeve.

OBI: Obi.

GRUNER: Gruner.

GARY: Goodnight. Don't abuse cats.

MAEVE: It is never about animals.