Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Compress multiple folders, each into its own zip archive

Compress multiple folders, each into its own zip archive

for i in */; do tar -czvf "${i%/}.tar.gz" "$i"; done

Example:

for i in */; do 
  tar -czvf "/Volumes/TamProjects/Tam/Projects/${i%/}.tar.gz" "$i"; 
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.