perl -ne 'print if /str1/ || /str2/' file #### C:\> perl -ne "print if /str1/ || /str2/" file