Live data from Hacker News

Curl vs. Wget

daniel.haxx.se

21–30 of 205 posts

Re: Curl vs. Wget

#21
post #3

I instinctively go to `wget` when I need to, uhm, get the file into my computer[1]. `curl -O` is a lot more effort :P Other than that, curl is always better. [1] Aliasing `wget` to ~`curl -O` might be a good idea :)

I don't think curl can mirror.

Re: Curl vs. Wget

#22
post #10

Earlier quoted context omitted.

I don't think you can: "[Wget's] ability to recover from a prematurely broken transfer and continue downloading has no counterpart in curl."

curl -C - -O filename url -C continues from an offset; "-C -" uses the length of the output file as the offset.

That's what I tried a couple years ago and it failed. Might try it again some time.

Re: Curl vs. Wget

#23
I use wget when I need to download things.

curl is for everything else (love it when it comes to debugging some api)... Httpie is not bad too for debugging but most of them time I forget to use it.

Re: Curl vs. Wget

#24

Also putting this out there—for nicer REST API interaction on the CLI, and a little more user-friendliness, you might also want to add HTTPie[1] to your toolbelt. It's not going to replace curl or wget usage, but it is a nicer interface in certain circumstances. [1] https://github.com/jkbrzt/httpie

Ha, I just got to using `jq` regularly (which is already a huge improvement). Now this ..

Re: Curl vs. Wget

#26
Though only briefly mentioned in this article at the buttom, I'd like to give a huge shoutout to aria2. I use it all the time for quick torrent downloads, as it requires no daemon and just seeds until you C-c. It also does a damn good job at downloading a list of files, with multiple segments for each.

Re: Curl vs. Wget

#27

There is no other industry where tools are debated so much as in IT. We literally waste tonns of hours on arguing over minor differences and nuances that really should not matter that much.

You clearly aren't familiar with US gun culture, e.g. plastic Glock v. metal 1911, striker fired vs. Single Action, Gaston Glock vs. John Moses Browning! Light, fast 9 mm Europellet vs. heavy, slow .45 (11.5 mm) Auto Colt Pistol ... and those are just two of the most prominent right now. Let me assure you, this isn't unique to IT!

Re: Curl vs. Wget

#28
My favorite use of wget: mirroring web documentation to my local machine.

    wget -r -l5 -k -np -p https://docs.python.org/2/
Rewrites the links to point local where appropriate, and the ones which are not local remain links to the online documentation. Makes for a nice, seamless experience while browsing documentation.

I also prefer wget to `curl -O` for general file downloads, simply because wget will handle redirects by default, `curl -O` will not. Yes, I could remember yet another argument to curl... but why?

That said, I love curl (combined with `jq`) for playing with rest interfaces.

Re: Curl vs. Wget

#29
post #18

Earlier quoted context omitted.

Lets compare the length of the man page: $ man curl | wc -l 1728 $ man wget | wc -l 1096 How about the --help output? $ curl --help | wc -l 178 $ wget --help | wc -l 176 The wget help is nicer, grouping options together by category and with longer text. curl just has a long list of options in alphabetical order. How many (long) options do they have? $ curl --help | grep -- -- | wc -l 175 $ wget --help | grep -- -- |…

"I'm glad I typed `man wget` instead of `wget --help`" -- no one ever You want the `wget --help` text over the man page, 99% of the time. The other 1%, you want the full info manual. The man page is an awful mix between the two; too dense for scanning through for the flag you need, but not containing the full information when you need specifics.

> no one ever

Except [at least] me.

I like man better because it's consistent. Some tools want --help, -help, -h, -H, -\? etc.

I like man better because I can search it.

I like man better because it gives me the details, not just a list.

Re: Curl vs. Wget

#30
post #26

Though only briefly mentioned in this article at the buttom, I'd like to give a huge shoutout to aria2. I use it all the time for quick torrent downloads, as it requires no daemon and just seeds until you C-c. It also does a damn good job at downloading a list of files, with multiple segments for each.

+1 for aria2. It's like the VLC of command-line download tools - it Just Works with anything.

https://aria2.github.io/

Post reply on HN