this post was submitted on 03 Aug 2026
388 points (98.0% liked)
Programmer Humor
32608 readers
700 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 3 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
catis misunderstood a lot. The purpose of cat is to combine multiple files together (it's literally short for "concatenate"), likecat *.logto combine all log files together.If you're just using it for a single file, then you should just redirect the file to stdin. These two command lines behave similarly:
For
head,tail,grepand some other commands, you can just pass in the file name directly as an argument (e.g.grep whatever foo.txt).You'll see
cat FILE |all the time because it's just a natural start to a pipeline. Youcat FILEto see the content unfiltered before filtering it with further commands.