Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jzeferino/a84ab00fcd7df2d794172e8e6a13466c to your computer and use it in GitHub Desktop.
Save jzeferino/a84ab00fcd7df2d794172e8e6a13466c to your computer and use it in GitHub Desktop.
Removes bin, obj and packages from current folder recursively
#!/bin/bash
declare -a arr=("obj" "bin" "packages") # Remove/add folders you want to clean up.
read -p "Delete $(printf "%s, " "${arr[@]}")folders under $PWD? (y/n) " answer
case ${answer:0:1} in
y|Y )
for folder in "${arr[@]}"
do
echo "Cleaning $folder"
find . -name $folder -type d -exec rm -rf {} +
done
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment