Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save carlohcs/f75bb12d1f568032e6c30ee47470e77e to your computer and use it in GitHub Desktop.
Save carlohcs/f75bb12d1f568032e6c30ee47470e77e to your computer and use it in GitHub Desktop.
Compress files to separate folders and exclude folders
#!/bin/bash
currentFolder=$(pwd)
echo "#################################"
echo "# Compressing folders from ${currentFolder}"
echo "#################################"
for i in */; do tar -czvf "${i%/}.tar.gz" --exclude "node_modules" --exclude ".next" "$i"; done
echo "Done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment