this post was submitted on 24 May 2024
391 points (98.0% liked)
Programmer Humor
32481 readers
248 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Please excuse my ignorance, but what is grep, what are the do's and dont's of logging and why are people here talking about having an entire team maintain some pipeline just to handle logs?
It's a command line tool which filters for all lines containing the query. So something like
cat log.txt | grep Error5
Would output only lines containing Error5
or if its a complex error cat log.txt|grep keyword1|grep keyword 2 and so on.
You can just do
In the back of my mind I know this is there, but the
cat | grep
pattern is just muscle memory at this pointfor me as well.
Just remember that if you aren't actually concatenating files,
cat
is always unnecessary.I've been 'told off' so many times by the internet for my cat and grep combos that I still do it, then I remove the cat, it still works, and I feel better. shrug