is there a way to do this?
cat somefile.txt | grep this_pattern OR grep that_pattern
I want display only certain lines from a large file however not just by one pattern.
For example
cat output.txt | grep "username" OR grep "connection-time" OR grep "disconnect-time"
This would conveniently give me something like this which is all I want if I could use multiple grep's based on a logical OR
username = bob
connection-time : <date & time>
disconnect-time : <date & time>
username = ron
connection-time : <date & time>
disconnect-time : <date & time>
username = jack
connection-time : <date & time>
disconnect-time : <date & time>
... and so on.
grep -e this -e thatis all I needed, thxgrep -E 'username|(connection|disconnect)-time'but in general you might find it simpler to use awk than grep when you have multiple patterns to match since it uses compound conditions, not just individual regexps, e.g.awk '/this/ && /that/',awk '/this/ || /that/',awk '/this/ && (/foo/ || /bar/)', etc.