You can use diff -B or –ignore-blank-lines options to ignore changes where lines are all blank.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
## ignore changes where lines are all blank echo -e "hello\n\nworld" > myfile1 ## create some files echo -e "hello\nworld" > myfile2 diff myfile1 myfile2 ## blank lines are also compared ## returns ## 2d1 ## < diff -B myfile1 myfile2 ## ignore changes where lines are all blank ## returns nothing as blank lines are ignored rm -r my* |