Suppose I have a large zip file (>50GB) and I want to extract some files off of it from the command line.
To get the files I run the command:
unzip -l myfile.zip | grep "foo"
which gives me a list of zip entries; how do I extract those files that pass through the grep filter? I tried using xargs unzip -j
but I'd like some cleaner solution as the zip entries require cleaning of useless information.
unzip -j myfile.zip '*foo*'
– Stéphane Chazelas Jul 28 '17 at 15:20unzip -l
also reports in the header or trailer; e.g. "archive", "zip", "length", "date", "time", "name", "file", or numbers that match the total bytes or number of files. – Jeff Schaller Jul 28 '17 at 16:32