spadel
spadel

Reputation: 1036

How to download a file over terminal when I don't know the explicit link?

I want to download [http://dreamdragon.github.io/PennAction/] over the terminal (ubuntu). I tried via curl and wget by adding latest.tar.gz, but it doesn't work. It's probably a stupid question, but hopefully someone can quickly tell me the answer in that case.

Upvotes: 0

Views: 53

Answers (1)

0stone0
0stone0

Reputation: 43944

If you download the tar.gz and use the download tab of the browser, you can find the download url to be;

https://codeload.github.com/dreamdragon/PennAction/legacy.tar.gz/gh-pages

Using with the -O, -J and -L options you can download the tar.gz

curl -O -J -L https://codeload.github.com/dreamdragon/PennAction/legacy.tar.gz/gh-pages

The 'magic' is due the -J option:

-J/--remote-header-name

(HTTP) This option tells the -O/--remote-name option to use the
server-specified Content-Disposition filename instead of extracting a filename from the URL.

Upvotes: 2

Related Questions