Skip to content

Instantly share code, notes, and snippets.

@rupertbates
Created December 16, 2014 15:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rupertbates/69a272a68a34f796a903 to your computer and use it in GitHub Desktop.
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
#!/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