Linux Tip: grep for multiple words

Quick linux tip for grepping for multiple words at the same time. Use the -e option for each pattern that you want to match. If you wanted to search for all files containing either *html* or *script*:

grep -e html -e script *

Post navigation

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>