How to curl and unzip to a certain directory?

you curl a file to stdout then unzip to some dir.


unzip (version 6.00) can not extract files read from standard input (this is mentioned in the unzip manual, in the "BUGS" section), so the file will need to be saved locally before extraction:

curl -o myfile.zip "some URL"
unzip myfile.zip -d "some directory"
rm -f myfile.zip

where some directory is the directory into which you'd like to extract the archive.

  • 7
    But jar can... – Stephen Kitt Jan 30 '18 at 22:18
  • 2
    As @StephenKitt said: curl $zip_file_url | jar xv – Noam Manos Jan 15 '20 at 13:51

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