Для проверки общих данных вы можете использовать comm
:
DESCRIPTION
The comm utility reads file1 and file2, which should be sorted lexically,
and produces three text columns as output: lines only in file1; lines only in
file2; and lines in both files.
Другим полезным инструментом будет merge
:
DESCRIPTION
merge incorporates all changes that lead from file2 to file3 into file1.
The result ordinarily goes into file1. merge is useful for combining separate
changes to an original.
sort
может испортить ваш заказ.Вы можете попробовать следующую команду awk
.Он не был проверен, поэтому убедитесь, что вы сделали резервную копию своих файлов.:)
awk ' !x[$0]++' big_merged_file
Это удалит все дубликаты из вашего файла.