Skip to content

Instantly share code, notes, and snippets.

@wcmatthysen
Last active October 5, 2016 17:15
Show Gist options
  • Save wcmatthysen/3c33bc156cfb864b72913379a7d746e4 to your computer and use it in GitHub Desktop.
Save wcmatthysen/3c33bc156cfb864b72913379a7d746e4 to your computer and use it in GitHub Desktop.
Remove all files in directory that are copies of given file.
#!/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