Created
December 16, 2014 15:56
-
-
Save rupertbates/69a272a68a34f796a903 to your computer and use it in GitHub Desktop.
Remove any files from directory 1 which are in directory 2. Eg. ./remove-files ~/my-first-dir ~/my-second-dir
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/bash | |
for i in $( ls $1 ); do | |
echo Removing: $2$i | |
rm $2$i | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment