PSA: Stop Abusing the cat Command and Let Cats Be Cats

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

11scooterbooper💬 13

I'm sharing a public service announcement to stop the unnecessary abuse of the cat command in shell scripts. Piping a single file through cat spawns an extra process that does nothing but copy bytes to a program that can already read the file itself. Tools like grep, wc, head, and awk can open files directly. Let's be humane and let cat do what it was designed for: concatenating multiple files.

"Piping a single file through cat spawns an entire process whose only job is to copy bytes to a program that already knew how to read them."

More from this day · 2026-07-18