18

How to curl and unzip to a certain directory?

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

1 Answers1

22

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.

Kusalananda
  • 333,661