Live data from Hacker News

Curl vs. Wget

daniel.haxx.se

131–140 of 205 posts

Re: Curl vs. Wget

#131

For my usage: * Wget's the interactive, end-user tool, and my go-to if I just need to download a file. For that purpose, its defaults are more sane, its command line usage is more straightforward, its documentation is better-organized, and it can continue incomplete downloads, which curl can't. * Curl's the developer tool-- it's what I'd use if I were building a shell script that needed to download. The command line…

wow what the heck libcurl supports a ridiculous number of protocols (https://curl.haxx.se/libcurl/)

Re: Curl vs. Wget

#132
I use curl because it is generally installed. I prefer not to install wget, especially on customer machines because it stops 90% of script kiddies. For some reason wget is the only tool they will attempt to use to download their sploit.

Re: Curl vs. Wget

#133
post #58

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

I've been loving HTTPie, and for my somewhat idiosyncratic usage it's completely replaced curl and wget. (Of course, most people probably don't spend as much time as me fiddling with poorly documented third party REST APIs.) Also amazing: jq.

I use httpie for interacting with APIs and aria2c for downloading stuff. They're both perfect at their respective jobs.

Re: Curl vs. Wget

#134
post #67

Earlier quoted context omitted.

-C requires you to specify the byte offset, and you also need --append or >> so it's not quite the same.

Actually no. From the manpage: Use "-C -" to tell curl to automatically find out where/how to resume the transfer. It then uses the given output/input files to figure that out.

Correct, but very unintuitive

Re: Curl vs. Wget

#135
post #85
post #70

Earlier quoted context omitted.

I'm not sure why you feel like that, I switched back to Windows after ~1 year of using OSX, I wouldn't say its "miserable" there is really nothing I could do in OSX's command line that can't do in windows.

What is your Windows command-line environment? Plain CMD prompt or Cygwin? Or something else?

I use git bash, with conemu, to be honest I don't do anything crazy but most of the linux commands I need day to day just work.

Re: Curl vs. Wget

#136
post #129
post #70

Earlier quoted context omitted.

I'm not sure why you feel like that, I switched back to Windows after ~1 year of using OSX, I wouldn't say its "miserable" there is really nothing I could do in OSX's command line that can't do in windows.

I feel like you can't have really scratched the surface on what you can do in a real Unix shell. I doubt that Windows has support for things I use all the time (like command substitution <(some command) where the output of a command appears to be a file to a program).

I doubt you've used Powershell. Using objects on the cmdline is pretty ballin.

Re: Curl vs. Wget

#137
post #67

Earlier quoted context omitted.

Actually no. From the manpage: Use "-C -" to tell curl to automatically find out where/how to resume the transfer. It then uses the given output/input files to figure that out.

Correct, but very unintuitive

Also doesn't work with the command line utility's retry option as it gets the size only once and does not update it when retrying.

Re: Curl vs. Wget

#138

Earlier quoted context omitted.

This is an extremely minor quibble, but the dependency on Python makes me less inclined to use it. I'm stuck on Windows for a lot of the work I do so configuring Python is never fun and there is no one line installation method from what I can tell. Putting it up on chocolatey[0] might be a good idea. Not sure how feasible that is however. [0] https://chocolatey.org/packages?q=httpie

Should have lead that comment with "I'm on Windows, so". Of course it's going to be miserable to use any command-line tool on Windows. It's Windows.

I feel wget in PowerShell is useful.

PS> $page = wget http://www.yahoo.com/ PS> $page.Images | sort width | select src, width, height | Export-Csv -Encoding utf8 images.CSV

Re: Curl vs. Wget

#140
post #77
post #47

Earlier quoted context omitted.

Merge the code, hard link the filenames to the same executable and get it to change behavior based on the name it's invoked under.

No need to merge code. Take curl as is, and set different defaults based on executable name.

In that case I'd love for it to include resuming downloads though, but given the differences I don't think merging is going to be more useful than just adding the feature in curl.

Edit: nevermind, I just learned that wget can download a page's resources or even inline them (-k apparently), that's a bit of a way off from curl's purpose. Better keep them separate tools, although wget might benefit from using libcurl so they don't have to implement lots of stuff like https or http2.

Post reply on HN