Search code examples
bashzip

need to updating ZIP sub folder


I have a zip file

# unzip -l 2020-05-01.zip 
1561  05-02-2020 01:22   zzz/text.csv

I want to add a file b.txt in zzz folder

I try this

zip -ur 2020-05-01.zip b.txt

It adds the b.txt in the root folder of 2020-05-01.zip

I try a few random things but didn't get much...

Any idea how can I make this job done...

desired output

# unzip -l 2020-05-01.zip 

zzz/text.csv
zzz/b.txt

Solution

  • As @Poshi said in the comments.

    mkdir zzz
    mv b.txt zzz
    zip -u 2020-05-01.zip zzz/b.txt
    

    it solved the problem for me. Did it for you as well?