Skip to content
Advertisement

How to zip multiple folders separately in linux

Below mentioned folders contain some data. I need to zip all the folders separately.

JavaScript

With this Command, I can zip only one folder

JavaScript

How can I zip all the folders separately at once?

Advertisement

Answer

First, make sure that you are in the directory where the above mentioned folders are. Then run:

find . -type d -maxdepth 1 -execdir zip '{}.zip' '{}' ;

This will find all the directories and zip them with the names:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement