What is the curl equivalent to wget -x?

1

1

I want to use curl to save multiple files with the same local paths as would be produced by wget -x (ie, cleaned up versions of the full urls). But I can't find the right option in the curl docs. Is this possible?

curl --remote-name "Only the file part of the remote file is used, the path is cut off."

Alex I

Posted 2014-06-02T06:40:34.380

Reputation: 231

Answers

0

curl --create-dirs

man page says :

When used in conjunction with the -o option, curl will create the necessary local directory hierarchy as needed. This option creates the dirs mentioned with the -o option, nothing else. If the -o file name uses no dir or if the dirs it mentions already exist, no dir will be created.

Renju Chandran chingath

Posted 2014-06-02T06:40:34.380

Reputation: 1 461

Thanks, but this doesn't quite do it: wget -x both creates a local directory like this, and gives each file a path that matches their url (as close to 1:1 as possible). curl --create-dirs only does the first part of this: if a path is given with -o it will create the required directories, but it won't give a path from the url. – Alex I – 2014-06-02T07:33:05.257