I have two files which the order of lines is irrelevant, and I want to compare its content.
I looked into diff
documentation but could not find anything like --ignore-order
.
Any tips?
Right-click on the first file. Click on “Select for Compare” from the menu. Proceed to right-click on the second file. Click on “Compare with Selected.
Sort the files first:
$ sort file1 > file1.sorted $ sort file2 | diff - file1.sorted
Also, although I personally discourage this sort of thing, if you are using bash and this feature is enabled on your system you can avoid the temporary file by using a process substitution:
$ diff <(sort file1) <(sort file2)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With