Last active
October 5, 2016 17:15
-
-
Save wcmatthysen/3c33bc156cfb864b72913379a7d746e4 to your computer and use it in GitHub Desktop.
Remove all files in directory that are copies of given file.
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/sh | |
find "$2" -type f -exec sh -c 'cmp --silent "{}" "$1"; if [ $? -eq 0 ]; then rm "{}"; fi' \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment