There are cases where you search for files that contain a specific string or term. That is when Linux utilities such as grep or egrep can help. What if you are looking for files that must match more than one string? Here is a quick run down on how you can use grep or egrep to match multiple strings.
To grep for files that contain any of multiple keywords:
To grep for files that contain all multiple keywords:
To grep for files that contain multiple words (without any order) in one line:
To grep for files that contain multiple ordered words in one line:
Subscribe to Xmodulo
You can have daily Linux tutorials and FAQs delivered to your email inbox. Simply enter your email address below to subscribe to our mailing list. You will receive hands-on guides and carefully written tutorials related to Linux, everything for free.