Answer by mr.spuratic for Grep for This and NOT That in a File?
One liner:comm -2 -3 <(grep -rl addDesignControlChangeNotification . | sort ) \<(grep -rl removeDesignControlChangeNotification . | sort )grep -r is a recursive grep, <() is process...
View ArticleAnswer by terdon for Grep for This and NOT That in a File?
Here's one that is loosely based on Rich Homolka's answer, but works on directory trees:find . -type f -exec grep -l addDesignControlChangeNotification {} \; | while IFS= read -r file; do grep -q...
View ArticleAnswer by Rich Homolka for Grep for This and NOT That in a File?
this should work:FIRST=addDesignControlChangeNotificationSECOND=removeDesignControlChangeNotificationgrep -l $FIRST * | while IFS= read -r FILEdo grep $SECOND "$FILE"&> /dev/null if [ $? -ne 0 ]...
View ArticleGrep for This and NOT That in a File?
How can I grep for files in a directory structure that have this textaddDesignControlChangeNotificationbut are missing this textremoveDesignControlChangeNotificationThanks!Note: I mean the directory...
View Article