Create individual tar.gz archive for every directory found in current location

This is how to automatically create individual tar.gz archive for every directory found in current location. Sometimes the whole directory might be too big to archive so I need to go one more level under and create a separate archives for each directory found.

Method 1:

find * -maxdepth 0 -type d -exec tar zcvf {}.tar.gz {} \;

Method 2:

for i in `ls ./`; do tar czvf "$i".tar.gz "$i" ; done

References, Sources and Credits:





Comments

Popular posts from this blog

How to recalibrate your Samsung Note 4 battery

How to import Tasker projects, profiles, tasks and scenes

How to turn your Windows 7 laptop or dekstop into a WiFi repeater or extender

A Better SKMEI 1358 Instructions Manual