Last active
June 15, 2016 09:42
-
-
Save imchao9/4eb9b6c23288fd69ab44 to your computer and use it in GitHub Desktop.
除指定文件文件夹外删除文件和文件夹并打包 delete file and document and zip
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 | |
lessonId=(1 2 3 4 5 6 7 8 9 10) | |
for id in ${lessonId[*]}; | |
do | |
find ./$id -type f -not \( -name 'challenge.html' -or -name 'receive.html' -or -name 'reward.html' -or -name 'story.html' -or -name 'task.html' \) -delete | |
find . -type d -not \( -name 'challenge' -or -name 'receive' -or -name 'reward' -or -name 'story' -or -name 'task' \) -delete | |
zip -r $id.zip $id | |
done | |
find . -type d \( -name 'libs' -o -name 'node_modules' \) -exec rm -rf {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment