Say I have a file that contains:
Release 2.1 OS: RHEL File: package_el6_2.0.1.1_x86_64.rpm
Release 2.1 OS: RHEL File: package_el6_2.0.1.1_i686.rpm
Release 2.1 OS: RHEL File: package_el7_2.0.1.1_x86_64.rpm
Release 2.1 OS: RHEL File: package_el7_2.0.1.1_i686.rpm
I want to grep and match lines that only contain 'package', 'el6', and 'x86_64'
How would I go about doing that on a one liner using grep? The line must match all three and grep shouldn't care about how many characters are in between. If there is a better tool for the job, I'm happy to use that instead.
I've tried the following and got no results:
grep package*el6*x86_64*
Seeing posts and documentation, I understand that * does not mean the same thing as it would in shell. I'm looking for the equivalent of it to use in regex. Hope this makes sense.
package*el6*x86_64*
Reading through some documentation and posts, I understand that * does not mean the same in regex. But I don't see anything that I can use to replace it with.