ceph-diff-sorted file1 file2
The output is simplified in comparison to that of the standard diff tool available in POSIX systems. Angle brackets ('<' and '>') are used to show lines that appear in one file but not the other. The output is not compatible with the patch tool.
This tool was created in order to perform diffs of large files (e.g., containing billions of lines) that the standard diff tool cannot handle efficiently. Knowing that the lines are sorted allows this to be done efficiently with minimal memory overhead.
The sorting of each file needs to be done lexcially. Most POSIX systems use the LANG environment variable to determine the sort tool's sorting order. To sort lexically we would need something such as:
$ LANG=C sort some-file.txt >some-file-sorted.txt
$ ceph-diff-sorted fileA.txt fileB.txt