on-internet
← Community

How do I find the text that matches a pattern?

Stack Overflow ·

NOTE: This is not a duplicate of any existing question, it's intended to show why such an extremely common and seemingly simple question is unanswerable and provide guidance on how people posting such questions can modify them to make them answerable so we don't have to keep providing the same guidance in comments almost every day and can just refer to this instead. Given the following input file: foo o.b bar I need to output all lines that match the pattern o.b so my expected output is: o.b and I have tried awk '"o.b"' file but that output all lines (this part just added to avoid complaints t

Comments

Sign in or sign up to comment and upvote.

No comments yet.