I have 2 lists with files with their md5sum checks. The lists have different paths even that the files are the same. I want to check the md5 sums of each file. We are talking for thousands of files and that's why I need script to show me only the differences. The first list is the vanilla and the second is the current state of the files. I want to find which of the files are changed/different than the original. To do that I want to compare the 2 lists. On every line there is md5 sum and file location/name. Did anyone have an idea how to do that? And what happens if there is one extra file in one of the lists?!
Example of content in first file with check sums (vanila list):
df7a0edcb7994581430379db56d8d53b /home/user/vanila/file-1.php
e1af39e94239a944440ab2925393ae60 /home/user/vanila/file-2.php
ce74e43d24d9c36cd579e932ee94b152 /home/user/vanila/file-3.php
95b7d47ed7134912270f8d3059100e8c /home/user/vanila/file-4.php
Example of content in second file with check sums (active list):
df7a0edcb7994581430379db56d8d53b /home/user/file-1.php
94b2a24a1fc9883246fc103f22818930 /home/user/file-1.1.php
e1af39e94239a944440ab2925393ae60 /home/user/file-2.php
ce74e43d24d9c36cd579e932ee94b152 /home/user/file-3.php
f5233ee990c50aade7c4e3ab9b4fe524 /home/user/file-4.php
Expecting results:
To show me that file-4.php is with different md5 sum.
If shows that there is an extra file (file-1.1.php) it's a bonus!
An attempt using
Awk
which is the right tool meant for this,Where,
file2
andfile1
are as followsTo find the file is not present in one and not in other,