Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Count files and sizes
- find ./*/spam/ -type f | echo "I found " `wc -l` "spams" \;
- du -shc ./*/spam/* | echo "Size of spams:" `grep total`
- read -r -p "Do you want to delete ALL spams? [Yes/No] " response
- if [[ "$response" =~ ^([yY][eE][sS]|[yY])+$ ]]
- then
- #Delete
- find ./*/spam/ -type f -exec rm -rf ./*/spam/* {} \;
- echo "Spams executed"
- exit 1
- else
- echo "We didn't delete anything"
- exit 2
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement