Create Separate Zip Files From All Directories In Source Directory

  1. Knowledge Base
  2. Systems Administration
  3. Backup
  4. Create Separate Zip Files From All Directories In Source Directory

Navigate to the desired source directory using

cd

Run the following command:

for directory in */; do zip -r "/destination/path/${directory%/}.zip" "$directory"; done

Leave a Reply

Your email address will not be published. Required fields are marked *