2

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

1 Answer 1

1

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.

1
  • 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
    Commented Jun 2, 2014 at 7:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .