linux - Is it possible to use "AND " and "NOT" condition in the same grep command -


i need search in directory of files has pattern1 not pattern2.

grep pattern1 $(grep -l pattern2 *) 

is easiest way it, if understand correctly want. -l means "print names of files not contain pattern"; it's inverse of -l. not work correctly if have files whitespace or other shell metacharacters in names.


Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

C# WinForm - loading screen -