Quantcast
Channel: Grep for This and NOT That in a File? - Super User
Browsing all 4 articles
Browse latest View live

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 Article



Answer 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 Article

Answer 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 Article

Grep 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
Browsing all 4 articles
Browse latest View live




Latest Images