Created
April 7, 2017 20:47
-
-
Save granolocks/eed53d49ee5c53b366e4ea737b353769 to your computer and use it in GitHub Desktop.
delete files out of 'UNSORTED' directory that are sorted into other directors that are a peer to UNSORTED
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
mkdir TO_DELETE | |
for i in $(ls UNSORTED ) | |
do | |
x=$(find . -type f -name $i | grep -v UNSORTED) | |
[[ '' != $x ]] &&\ | |
echo $x &&\ | |
echo UNSORTED/$i &&\ | |
mv UNSORTED/$i TO_DELETE | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment