Created
September 18, 2014 16:04
-
-
Save thomasfr/30f24d1b6201b6b4327d to your computer and use it in GitHub Desktop.
Recursively compare two directories and print which files have changed. Ignore binary files and do not show non existing files in `dir2`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
dir1="/tmp/dir1" | |
dir2="/tmp/dir2" | |
IFS=$'\n' | |
for file in $(grep -Ilsr -m 1 '.' "$dir1"); do diff -q --exclude="cache" "$file" "${file/${dir1}/${dir2}}" 2> /dev/null; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment