How to export a special file from ZIP archive?

2019-06-11 02:26发布

I have a ZIP archive with many files, is there any way to export or extract a special file from the ZIP archive without unzip the whole archive?

For example, test.zip has a.txt & b.txt, how to extract a.txt only?

test.zip/
        a.txt
        b.txt

标签: bash shell zip
2条回答
Evening l夕情丶
2楼-- · 2019-06-11 03:03

unzip has an option -x with which you can say which files you don't need

manpage of unzip tells this

unzip data1 -x joe => extract all files except joe from zipfile data1.zip

查看更多
Animai°情兽
3楼-- · 2019-06-11 03:18

Yes there is:

unzip test.zip a.txt

The argument after the filename is the file to be extracted. In case read:

man unzip
查看更多
登录 后发表回答