1
Thanks

A few words of thanks would be greatly appreciated.

Zip multiple files one by one


Zip multiple files one by one




Issue


I want a hundred zip files in a directory one by one.
such that:
foreach dir *. img do in zip $ 1.zip 

Solution


There is the right command line;
lami20j@debian-acer:~$ ls *.img
a10.img  a1.img  a2.img  a3.img  a4.img  a5.img  a6.img  a7.img  a8.img  a9.img
lami20j@debian-acer:~$ ls *.img | zip archive_img -@
  adding: a10.img (stored 0%)
  adding: a1.img (stored 0%)
  adding: a2.img (stored 0%)
  adding: a3.img (stored 0%)
  adding: a4.img (stored 0%)
  adding: a5.img (stored 0%)
  adding: a6.img (stored 0%)
  adding: a7.img (stored 0%)
  adding: a8.img (stored 0%)
  adding: a9.img (stored 0%)
lami20j@debian-acer:~$ zip -sf archive_img.zip 
Archive contains:
  a10.img
  a1.img
  a2.img
  a3.img
  a4.img
  a5.img
  a6.img
  a7.img
  a8.img
  a9.img
Total 10 entries (0 bytes)
lami20j@debian-acer:~$ file archive_img.zip 
archive_img.zip: Zip archive data, at least v1.0 to extract

Note


Solved by lami20j
1
Thanks

A few words of thanks would be greatly appreciated.

Ask a question
CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jeff Pillou, founder of CCM.net. CCM reaches more than 50 million unique visitors per month and is available in 11 languages.
This document, titled "Zip multiple files one by one," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (https://ccm.net/).

0 Comments