You can use diff –from-file=FILE1 option to compare FILE1 to all operands; FILE1 can be a directory.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
## compare FILE1 to all operands echo "hello" > myfile1 ## create some files echo "world" > myfile2 echo "cloud" > myfile3 echo "linux" > myfile4 ## myfile1 is compared with rest of the files diff --from-file=myfile1 myfile2 myfile3 myfile4 ## returns ## 1c1 ## < hello ## --- ## > world ## 1c1 ## < hello ## --- ## > cloud ## 1c1 ## < hello ## --- ## > linux rm -r my* |