Last active
August 29, 2015 14:04
-
-
Save miraculixx/511d9bdc1e6cbaedd538 to your computer and use it in GitHub Desktop.
remove files extracted from a zip file
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
#!/usr/bin | |
# Purpose: | |
# | |
# you have unzipped a zip file and realise the files are in the wrong place? | |
# simply remove the files again using this command | |
# | |
# Usage: cleanzipextract <zipfile> | |
# | |
# WARNING: this will list all files and then unconditionally remove all files it finds | |
# USE WITH CAUTION | |
# | |
# PROVIDED AS IS, THIS IS NOT FIT FOR PURPOSE, ANY WARRANTY EXLUCDED | |
# | |
unzip -l $1 | cut -c30-250 | grep -v "\-\-" | head -n-1 | tail -n+3 | xargs rm -rf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment