Ignore newlines with diff
问题 I'd like to ignore newlines when I compare c source files. For example I want following two codes are reported they are same. // codeA int main(int argc, char *argv[]) { // codeB int main(int argc, char *argv[]) { I already have tried following options but could not get the result. diff -b codeA codeB diff -w codeA codeB 回答1: You can pretty print both files using, for example, GNU Indent, http://www.gnu.org/software/indent/ , and then compare them with diff. 回答2: There is a tool called "word