Skip to content

Instantly share code, notes, and snippets.

@claudius108
Created June 6, 2020 11:38
Show Gist options
  • Save claudius108/00be40b21f623aeb22b500b145f6a110 to your computer and use it in GitHub Desktop.
Save claudius108/00be40b21f623aeb22b500b145f6a110 to your computer and use it in GitHub Desktop.
Files that are in both Dir1 and Dir2:
find "$Dir1/" "$Dir2/" -printf '%P\n' | sort | uniq -d
Files that are in Dir1 but not in Dir2:
find "$Dir1/" "$Dir2/" "$Dir2/" -printf '%P\n' | sort | uniq -u
Files that are in Dir2 but not in Dir1:
find "$Dir1/" "$Dir1/" "$Dir2/" -printf '%P\n' | sort | uniq -u
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment