3 ms·
This "-O" seemed dubious to me so I took a look. Turns out... yep, it's not as simple as that. "curl -O foo" is not the same as "wget foo". wget will rename
by rachelbythebay 12y ago
This "-O" seemed dubious to me so I took a look. Turns out... yep, it's not as simple as that.
"curl -O foo" is not the same as "wget foo". wget will rename the incoming file to as to not overwrite something. curl will trash whatever might be there, and it's going to use the name supplied by the server. It might overwrite anything in your current working directory.
Try it and see.
- bkirwi 12y agoAccording to the manpage, the filename depends only on the supplied URL: Write output to a local file named like the remote file we get. (Only the file part of the remote file is used, the path is cut off.) The remote file name to use for saving is extracted from the given URL, nothing else. wget is a hugely useful tool for making local copies of websites and similar things -- the no-clobber rule is useful there, and the built-in crawling and resource fetching is fantastic. OTOH, for most things, I actually like curl's 'dumb' behaviour; it seems to match up better with the rest of the UNIX ecosystem.