this post was submitted on 24 Sep 2025
1288 points (98.0% liked)
Programmer Humor
27127 readers
2574 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 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
cat ~/.bash_history | grepUseless use of cat?
You saying I can just skip cat in that command and it works?
history | grep 'cat'My output was empty for that command.
Guess why?
Because
historyonly gives the last few lines in my system.How did I not know this. Thank you!
it's
grep STRING FILEto be preciseor
awk '/STRING/′ FILEif you prefer that for some reasonYes, it was meant to be a self deprecating admission that I have used this unnecessarily verbose command.
Ah. Well. I can not be blameless on this. I also probably use cat unnecessarily still. But less so with grep these days. I'm getting better... I swear!