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

City Code Table for Casio SGW300HD-1AV Watch

How to force only 4G or LTE network connection for Samsung Galaxy Note 4

Mounting NFS share directory from D-link DNS 320L on Ubuntu 12.04 LTS