I have two projects named project1
and project2
with identical file trees as follows.
project1/, project2/
.
├── src
│ ├── index.html
│ ├── main.js
│ ├── normalize.js
│ ├── routes
│ │ ├── index.js
│ │ └── Home
│ │ ├── index.js
│ │ └── assets
│ ├── static
│ ├── store
│ │ ├── createStore.js
│ │ └── reducers.js
│ └── styles
└── project.config.js
Now I want to compare to see if the following files from each tree are identical to each other.
files-to-compare.txt
src/main.js
src/routes/index.js
src/store/reducers.js
project.config.js
Is there any way to accomplish this using a single unix command which leverages the list of files-to-compare.txt without having to do a separate command for each file in the list? If so, how?
Edit: This is a different question than this one because that question asks about comparing all the files in two directories. This question asks about specific files sprinkled across multiple directories. Excluding many of those that would have otherwise been included by the answers to the other question.