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

https://www.abuseofcats.com/

Comments

12 points · 3 comments · view on lemmy.world

3 Comments

pelya@lemmy.world · 1 pts · 18d

Huh, I actually forgot cat is used to join several files together. Last time I needed to concatenate two files, I did

{ cat file1 ; cat file2 ; } > output

But the most valid case is when I want to unpack .gz or .xz archive but do not want to delete the original file, as xz -d will do by default. So I naturally do

cat input.img.xz | xz -d > output.img

I've heard rumours that xz has a special option to not delete the original file, but I know no one brave enough to search through the xz manpage.

PancakesCantKillMe@lemmy.world · 1 pts · 18d (1 reply)

Useless use of cat award.

a_non_monotonic_function@lemmy.world · 1 pts · 18d

Who cats into wc?