Created
May 17, 2020 17:16
-
-
Save shortland/fa7f2566414ce6a34263217831329daa to your computer and use it in GitHub Desktop.
Bash 1 liner script to remove duplicate files that appear in specified directories
This file contains hidden or 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
| # Change the dir to remove duplicate files from - and the directory to read from | |
| cd dirToRemoveDupesFrom && for f in *.c ; do find ../dirToCheckIfFileExistsAlready -name $f -exec rm $f \; ; done" | |
| # Makefile equivalent | |
| bash -c "cd $(RMD) && for f in *.c ; do find $(SRCD) -name \$$f -exec rm \$$f \; ; done" |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It looks for duplicate files that have the file extension .c, just change that to your needs~