Skip to content

Instantly share code, notes, and snippets.

@andyvanee
Created October 11, 2016 16:42
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 andyvanee/420e103f530ca724f91391cabf806e3d to your computer and use it in GitHub Desktop.
Save andyvanee/420e103f530ca724f91391cabf806e3d to your computer and use it in GitHub Desktop.
Show a diff of two directory trees
#!/usr/bin/env bash
#
# Both find commands will output the file name without prefix as well as the file size
# `diff -u` outputs a diff format compatible with gist files with the .diff extension
# -printf does not work with OSX find unfortunately
#
diff -u <(find $1 -type f -printf '%s %P\n') <(find $2 -type f -printf '%s %P\n')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment