Find diffs between all files of same names across two copies of a directory in linux

From the command line run the following command:

for file in directory1/*; do diff "$file" "directory2/${file##*/}"; done

or for specific file types (example for txt files):

for file in directory1/*.txt; do diff "$file" "directory2/${file##*/}"; done

Leave a Comment

Your email address will not be published. Required fields are marked *