Consider for example a source code file, where the functions are drastically shuffled around. Is there is a command to check if the reordering of lines is the only change?
(that means no lines are added, removed or changed)
The simple answer is: "compare the sorted version of both files".
Obviously, this does not mean the two files have the same semantic as source files of a programming language (supposing are both syntactically correct).
I mention this one only because I want someone to write a GNU version...
Brenda S. Baker, of Bell Labs, wrote a system called dup that did what you want to do and more. You could use dup to compare two C-language systems, and find code that's kind-of-duplicated: a function copied and variables renamed or some such minor changes.
The whole SCOg Fiasco could have been avoided if an ethical person at SCO had compared Linux source to The Precious SCO "intellectual property".