Multiple Keyword Grep

The following syntax will list all lines in a file containing multiple keywords ‘println’ or ‘printStackTrace’ or ‘print’ in a file named “MyWork.java”

cat MyWork.java | grep ‘println\|printStackTrace\|print’

 

Leave a Reply

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