fir3net
PPS-Firenetbanner-780.5x190-30-03-17

Recursive ZIP command

This is a small command which will take each file in the directory that it is run in and zip the file and then remove the original.

for i in `ls` ; do zip=$(echo $i | sed s/iso/iso"."zip/) ; zip -r $zip $i && rm -fv $i ;  done

Tags: Shell

About the Author

RDonato

R Donato

Rick Donato is the Founder and Chief Editor of Fir3net.com. He currently works as a Principal Network Security Engineer and has a keen interest in automation and the cloud.

You can find Rick on Twitter @f3lix001