Skip to content

Instantly share code, notes, and snippets.

@yarwelp
Last active May 2, 2017 09:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yarwelp/156251449c707617061bfb314e42f1c4 to your computer and use it in GitHub Desktop.
Save yarwelp/156251449c707617061bfb314e42f1c4 to your computer and use it in GitHub Desktop.
Compare files in two directory trees

Compare files in two directory trees

Example directory trees:

mkdir -p ~/tmp/{hurr,durr}/{a,b,c,d}/

for i in ~/tmp/{hurr,durr}/{a,b,c,d}/k ; do echo "cool beans" > $i ; done

echo yo > ~/tmp/hurr/a/fo_sho
echo yup > ~/tmp/durr/c/yup
:> ~/tmp/durr/d/k

Comparison:

diff -rq ~/tmp/hurr/ ~/tmp/durr/
Only in /home/erikn/tmp/hurr/a: fo_sho
Only in /home/erikn/tmp/durr/c: yup
Files /home/erikn/tmp/hurr/d/k and /home/erikn/tmp/durr/d/k differ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment