output.d 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. Long: output
  2. Arg: <file>
  3. Short: o
  4. Help: Write to file instead of stdout
  5. See-also: remote-name remote-name-all remote-header-name
  6. Category: important curl
  7. ---
  8. Write output to <file> instead of stdout. If you are using {} or [] to fetch
  9. multiple documents, you should quote the URL and you can use '#' followed by a
  10. number in the <file> specifier. That variable will be replaced with the current
  11. string for the URL being fetched. Like in:
  12. curl "http://{one,two}.example.com" -o "file_#1.txt"
  13. or use several variables like:
  14. curl "http://{site,host}.host[1-5].com" -o "#1_#2"
  15. You may use this option as many times as the number of URLs you have. For
  16. example, if you specify two URLs on the same command line, you can use it like
  17. this:
  18. curl -o aa example.com -o bb example.net
  19. and the order of the -o options and the URLs doesn't matter, just that the
  20. first -o is for the first URL and so on, so the above command line can also be
  21. written as
  22. curl example.com example.net -o aa -o bb
  23. See also the --create-dirs option to create the local directories
  24. dynamically. Specifying the output as '-' (a single dash) will force the
  25. output to be done to stdout.