Я пытаюсь найти разницу между двумя файлами, где я хотел бы узнать новые записи в файле_2. Например:
Если .txt содержит:
a
b
c
И b.txt содержит:
c
d
f
Я хотел бы получить d and f
Я использую команду: diff --changed-group-format="%>" --unchanged-group-format=''
mymach@dev-machine:~/test$ grep 'C:/Documents and Settings/pandep2/AppData/Local/Google/Chrome/User Data/CrashpadMetrics.pma~RF115cef5.TMP' file_1.log
C:/Documents and Settings/pandep2/AppData/Local/Google/Chrome/User Data/CrashpadMetrics.pma~RF115cef5.TMP
mymach@dev-machine:~/test$ grep 'C:/Documents and Settings/pandep2/AppData/Local/Google/Chrome/User Data/CrashpadMetrics.pma~RF115cef5.TMP' file_2.log
C:/Documents and Settings/pandep2/AppData/Local/Google/Chrome/User Data/CrashpadMetrics.pma~RF115cef5.TMP
mymach@dev-machine:~/test$ diff --changed-group-format="%>" --unchanged-group-format='' file_1.log file_2.log >diff_file.log
mymach@dev-machine:~/test$ grep 'C:/Documents and Settings/pandep2/AppData/Local/Google/Chrome/User Data/CrashpadMetrics.pma~RF115cef5.TMP' diff_file.log
C:/Documents and Settings/pandep2/AppData/Local/Google/Chrome/User Data/CrashpadMetrics.pma~RF115cef5.TMP
Поскольку в обоих файлах существовал один и тот же файл, почему команда diff по-прежнему сообщает об этом файле?