To find what's in filea
that isn't in fileb
, I have always done
similar things give you union, intersection, symetric difference etc. Recently I shortened it tocat filea fileb fileb | sort | uniq -u
which I thought was good fun.cat filea fileb{,} | sort | uniq -u
5 comments:
Neat. But surely in this contrived example, you're better off with:
cat file{a,b,b} | sort | uniq -u
Yeah, but it's only in my fake example that the 2 files share a prefix/suffix. E.g. "done_so_far" and "all_to_do".
What's wrong with "comm -23 <(sort <filea) <(sort <fileb)"?
it's 3 characters longer, that's what's wrong. =P
Adrian, I didn't know about comm or maybe I did but it's not in my common toolkit.
Post a Comment