交集
$ sort a b | uniq -d
$
sort
a b |
uniq
-d
并集
$ sort a b | uniq
差集a-b
$ sort a b b | uniq -u
a b b |
-u
文件乱序
cat tmp.txt | awk 'BEGIN{srand()}{print rand()" "$0}' | sort -k1,1 -n | cut -f2- > out.txt