The following commad will show how to create individual ZIP files from a collection of folders. The process will create a ZIP file for each folder – naming the ZIP file the name of the folder. For example, if you have a number of folders called:
- Example1
- Example2
- Example3
It will create Example1.zip, Example2.zip and Example3.zip.
How to create individual ZIP files from folders?
Following command will compress and create individual zip file of each folder in working directory.
for i in */; do zip -r "${i%/}.zip" "$i"; done
How to compress multiple folders, each into its own zip archive? Command to zip all folders in separately
Facebook Comments