重複していない行の抽出
「sort」 と 「uniq -u」 がキーです。
単一のファイルから
baz.txt
A
B
A
B
C
> sort baz.txt | uniq -u
C
複数のファイルから
foo.txt
A
B
C
bar.txt
A
B
D
> sort foo.txt bar.txt | uniq -u
C
D
また、片方のファイルの「D」だけ抽出したい場合は、
foo.txtを重ねることで「C」を重複させる。
> sort foo.txt foo.txt bar.txt | uniq -u
D
Author And Source
この問題について(重複していない行の抽出), 我々は、より多くの情報をここで見つけました https://qiita.com/i47_rozary/items/72bcfc262122745a9c60著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .