0

Is there a independent diff tool that ignores differences as long as they're only related to row ordering and not content? For example,

a.txt:

aa
bb

and

b.txt:

bb
aa

should be identical, since they have the same contents (white spaces are assumed to be the same for both files).

The easiest solution would be to simply add up the characters of the file and compare the results, right? Is there any existing tool that can do this?

1 Answer 1

3

You can sort both files and compare the result:

cmp <(sort a.txt) <(sort b.txt)

(or diff ...).

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.