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

Answer by mr.spuratic for Grep for This and NOT That in a File?

$
0
0

One liner:

comm -2 -3 <(grep -rl addDesignControlChangeNotification     . | sort ) \<(grep -rl removeDesignControlChangeNotification  . | sort )

grep -r is a recursive grep, <() is process substitution, and comm shows you lines that a pair of (sorted) files do/don't have in common. In this case we only want the column 1 output: lines in the first file (where "file" is really grep output) which are not in the second.


Viewing all articles
Browse latest Browse all 4

Trending Articles