Я использую эту версию diff на моем Synology NAS для проверки резервной копии:
xyz> diff
BusyBox v1.16.1 (2014-05-29 11:26:15 CST) multi-call binary.
Usage: diff [-abBdiNqrTstw] [-L LABEL] [-S FILE] [-U LINES] FILE1 FILE2
Compare files line by line and output the differences between them.
This implementation supports unified diffs only.
Options:
        -a      Treat all files as text
        -b      Ignore changes in the amount of whitespace
        -B      Ignore changes whose lines are all blank
        -d      Try hard to find a smaller set of changes
        -i      Ignore case differences
        -L      Use LABEL instead of the filename in the unified header
        -N      Treat absent files as empty
        -q      Output only whether files differ
        -r      Recurse
        -S      Start with FILE when comparing directories
        -T      Make tabs line up by prefixing a tab when necessary
        -s      Report when two files are the same
        -t      Expand tabs to spaces in output
        -U      Output LINES lines of context
        -w      Ignore all whitespace
Теперь я установил две папки на моем NAS, используя diff -q -r /a /b | tee xyz.log . Однако, похоже, что эти команды сравнивают только имена файлов, а не их содержимое, так как она сообщает Common subdirectories /a/file.ext and /b/file.ext для каждой пары файлов, то есть около 150.000 раз. Почему не сравнивается содержимое файла, и какую команду я должен использовать вместо?
