{"id":211,"date":"2009-02-17T07:10:25","date_gmt":"2009-02-17T07:10:25","guid":{"rendered":"https:\/\/fir3netwp.gmsrrpobkbd.com\/2009\/02\/17\/zip-command\/"},"modified":"2021-07-24T19:12:03","modified_gmt":"2021-07-24T19:12:03","slug":"zip-command","status":"publish","type":"post","link":"https:\/\/www.fir3net.com\/Programming\/Shell-Scripting\/zip-command.html","title":{"rendered":"Recursive ZIP command"},"content":{"rendered":"
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.<\/p>\n
for i in `ls` ; do zip=$(echo $i | sed s\/iso\/iso\".\"zip\/) ; zip -r $zip $i && rm -fv $i ; done<\/pre>\n","protected":false},"excerpt":{"rendered":"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<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[40],"tags":[],"yoast_head":"\n
Recursive ZIP command - Fir3net<\/title>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n