Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Properly download from github using wget and curl
wget --no-check-certificate --content-disposition https://github.com/joyent/node/tarball/v0.7.1
# --no-check-cerftificate was necessary for me to have wget not puke about https
curl -LJO https://github.com/joyent/node/tarball/v0.7.1
@ddimitrioglo

This comment has been minimized.

Copy link

@ddimitrioglo ddimitrioglo commented Nov 12, 2017

Thanks! 😉

@devpie

This comment has been minimized.

Copy link

@devpie devpie commented Mar 2, 2018

That's great. Thanks!!!

@dnanto

This comment has been minimized.

Copy link

@dnanto dnanto commented May 26, 2019

This was driving me crazy, thanks!

@ny0x696

This comment has been minimized.

Copy link

@ny0x696 ny0x696 commented May 27, 2019

Fantastic!! thank you

@lucasbasquerotto

This comment has been minimized.

Copy link

@lucasbasquerotto lucasbasquerotto commented Aug 23, 2019

Thanks!

@pushpdeep

This comment has been minimized.

Copy link

@pushpdeep pushpdeep commented Oct 25, 2019

Thanks :) :D

@guillerglez88

This comment has been minimized.

Copy link

@guillerglez88 guillerglez88 commented Nov 14, 2019

thanks 👍

@littlejeem

This comment has been minimized.

Copy link

@littlejeem littlejeem commented Dec 7, 2019

cheers!

@MagicJohnJang

This comment has been minimized.

Copy link

@MagicJohnJang MagicJohnJang commented Feb 17, 2020

Work! Amazing

@Darrenzzy

This comment has been minimized.

Copy link

@Darrenzzy Darrenzzy commented May 27, 2020

thx!

@tarpanpathak

This comment has been minimized.

Copy link

@tarpanpathak tarpanpathak commented Jul 24, 2020

Thx!

@OctavioBR

This comment has been minimized.

Copy link

@OctavioBR OctavioBR commented Aug 4, 2020

For people who like the long, more understandable form of curl options to be used in scripts:

  • -L → --location
  • -J → --remote-header-name
  • -O → --remote-name
curl --location --remote-header-name --remote-name https://github.com/joyent/node/tarball/v0.7.1
@OctavioBR

This comment has been minimized.

Copy link

@OctavioBR OctavioBR commented Aug 4, 2020

Don't know why --remote-header-name is required. It works fine only with --location & --remote-name

@g0d0

This comment has been minimized.

Copy link

@g0d0 g0d0 commented Aug 5, 2020

None of these examples work for me. 404 is returned.

@trylaarsdam

This comment has been minimized.

Copy link

@trylaarsdam trylaarsdam commented Aug 22, 2020

thanks for this!

None of these examples work for me. 404 is returned.

This likely means your URL is invalid (the file isn't on the server)

@dienluong

This comment has been minimized.

Copy link

@dienluong dienluong commented Aug 27, 2020

-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.

If the server specifies a file name and a file with that name already exists in the current working directory it will not be overwritten and an error will occur. If the server doesn't specify a file name then this option has no effect.

There's no attempt to decode %-sequences (yet) in the provided file name, so this option may provide you with rather unexpected file names.

WARNING: Exercise judicious use of this option, especially on Windows. A rogue server could send you the name of a DLL or other file that could possibly be loaded automatically by Windows or some third party software.

Source: https://curl.haxx.se/docs/manpage.html#-J

Generally, one shouldn't blindly use command options without knowing what they do.

@azmanhamid

This comment has been minimized.

Copy link

@azmanhamid azmanhamid commented Oct 8, 2020

TQ

@MetaKomora

This comment has been minimized.

Copy link

@MetaKomora MetaKomora commented Dec 22, 2020

Thank you so much

@DivineAlien

This comment has been minimized.

Copy link

@DivineAlien DivineAlien commented Jan 21, 2021

nice nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment