I have 2 different folders on different machines. they are supposed to be same but some time for unknown reason they are not. then we have to generate a report for files which are not matching.
I was doing as below -
cd folder1
find . -type f | sort | cksum >1.txt
cd folder2
find . -type f | sort | cksum >2.txt
1)
diff -w 1.txt 2.txt
still it shows lot of lines in diff even when file name/path/size/checksum is same. is there any nice and clean way to report the expected result.
2) i was able to generate good results (but not good format) by using -
cat 1.txt 2.txt | sort -k 3,3 | uniq -u
it does not tell me which file is from which folder (there is no < or > sign as we have in diff)
tyler_durden
thanks for suggestion
there are 2 issues
1) first ls wont show the files in sub directories. so we have to use find command. thats fine
2) main issue is still the same. if you do the diff of output from folder 1 and output from folder 2 it wont show properly as both the folder will have different no files so sort will be differnet and so the diff