]>
Commit | Line | Data |
---|---|---|
e306af50 TL |
1 | :orphan: |
2 | ||
3 | ========================================================== | |
4 | ceph-diff-sorted -- compare two sorted files line by line | |
5 | ========================================================== | |
6 | ||
7 | .. program:: ceph-diff-sorted | |
8 | ||
9 | Synopsis | |
10 | ======== | |
11 | ||
12 | | **ceph-diff-sorted** *file1* *file2* | |
13 | ||
14 | Description | |
15 | =========== | |
16 | ||
20effc67 | 17 | :program:`ceph-diff-sorted` is a simplified *diff* utility optimized |
e306af50 TL |
18 | for comparing two files with lines that are lexically sorted. |
19 | ||
20 | The output is simplified in comparison to that of the standard `diff` | |
21 | tool available in POSIX systems. Angle brackets ('<' and '>') are used | |
22 | to show lines that appear in one file but not the other. The output is | |
23 | not compatible with the `patch` tool. | |
24 | ||
25 | This tool was created in order to perform diffs of large files (e.g., | |
26 | containing billions of lines) that the standard `diff` tool cannot | |
27 | handle efficiently. Knowing that the lines are sorted allows this to | |
28 | be done efficiently with minimal memory overhead. | |
29 | ||
30 | The sorting of each file needs to be done lexcially. Most POSIX | |
31 | systems use the *LANG* environment variable to determine the `sort` | |
32 | tool's sorting order. To sort lexically we would need something such | |
33 | as: | |
34 | ||
35 | $ LANG=C sort some-file.txt >some-file-sorted.txt | |
36 | ||
37 | Examples | |
38 | ======== | |
39 | ||
40 | Compare two files:: | |
41 | ||
42 | $ ceph-diff-sorted fileA.txt fileB.txt | |
43 | ||
44 | Exit Status | |
45 | =========== | |
46 | ||
47 | When complete, the exit status will be set to one of the following: | |
48 | ||
49 | 0 | |
50 | files same | |
51 | 1 | |
52 | files different | |
53 | 2 | |
54 | usage problem (e.g., wrong number of command-line arguments) | |
55 | 3 | |
56 | problem opening input file | |
57 | 4 | |
58 | bad file content (e.g., unsorted order or empty lines) | |
59 | ||
60 | ||
61 | Availability | |
62 | ============ | |
63 | ||
64 | :program:`ceph-diff-sorted` is part of Ceph, a massively scalable, | |
65 | open-source, distributed storage system. Please refer to the Ceph | |
20effc67 | 66 | documentation at https://docs.ceph.com for more information. |
e306af50 TL |
67 | |
68 | See also | |
69 | ======== | |
70 | ||
71 | :doc:`rgw-orphan-list <rgw-orphan-list>`\(8) |