I have file with filepaths that I want to zip. At the moment I'm doing it like this:

zip files.zip -j@ < filepaths.txt

This works, but it creates .zip file that, when unzipped, unzips all of it's contents in a folder where unzip is run, effectively polluting that folder with thousands of files from files.zip.

Is there any way to create top level container when zipping list of files so that when I unzip files.zip I get 'files' directory and all of the files inside?

1 Answer 1


I've got an "-d extract files into exdir" option in my unzip (5.52) which seems to do what you need.

$ unzip -d files files.zip

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.