write-out.d 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. Long: write-out
  2. Short: w
  3. Arg: <format>
  4. Help: Use output FORMAT after completion
  5. ---
  6. Make curl display information on stdout after a completed transfer. The format
  7. is a string that may contain plain text mixed with any number of
  8. variables. The format can be specified as a literal "string", or you can have
  9. curl read the format from a file with "@filename" and to tell curl to read the
  10. format from stdin you write "@-".
  11. The variables present in the output format will be substituted by the value or
  12. text that curl thinks fit, as described below. All variables are specified as
  13. %{variable_name} and to output a normal % you just write them as %%. You can
  14. output a newline by using \\n, a carriage return with \\r and a tab space with
  15. \\t.
  16. The output will be written to standard output, but this can be switched to
  17. standard error by using %{stderr}.
  18. .B NOTE:
  19. The %-symbol is a special symbol in the win32-environment, where all
  20. occurrences of % must be doubled when using this option.
  21. The variables available are:
  22. .RS
  23. .TP 15
  24. .B content_type
  25. The Content-Type of the requested document, if there was any.
  26. .TP
  27. .B filename_effective
  28. The ultimate filename that curl writes out to. This is only meaningful if curl
  29. is told to write to a file with the --remote-name or --output
  30. option. It's most useful in combination with the --remote-header-name
  31. option. (Added in 7.26.0)
  32. .TP
  33. .B ftp_entry_path
  34. The initial path curl ended up in when logging on to the remote FTP
  35. server. (Added in 7.15.4)
  36. .TP
  37. .B http_code
  38. The numerical response code that was found in the last retrieved HTTP(S) or
  39. FTP(s) transfer. In 7.18.2 the alias \fBresponse_code\fP was added to show the
  40. same info.
  41. .TP
  42. .B http_connect
  43. The numerical code that was found in the last response (from a proxy) to a
  44. curl CONNECT request. (Added in 7.12.4)
  45. .TP
  46. .B http_version
  47. The http version that was effectively used. (Added in 7.50.0)
  48. .TP
  49. .B local_ip
  50. The IP address of the local end of the most recently done connection - can be
  51. either IPv4 or IPv6 (Added in 7.29.0)
  52. .TP
  53. .B local_port
  54. The local port number of the most recently done connection (Added in 7.29.0)
  55. .TP
  56. .B num_connects
  57. Number of new connects made in the recent transfer. (Added in 7.12.3)
  58. .TP
  59. .B num_redirects
  60. Number of redirects that were followed in the request. (Added in 7.12.3)
  61. .TP
  62. .B proxy_ssl_verify_result
  63. The result of the HTTPS proxy's SSL peer certificate verification that was
  64. requested. 0 means the verification was successful. (Added in 7.52.0)
  65. .TP
  66. .B redirect_url
  67. When an HTTP request was made without --location to follow redirects (or when
  68. --max-redir is met), this variable will show the actual URL a redirect
  69. \fIwould\fP have gone to. (Added in 7.18.2)
  70. .TP
  71. .B remote_ip
  72. The remote IP address of the most recently done connection - can be either
  73. IPv4 or IPv6 (Added in 7.29.0)
  74. .TP
  75. .B remote_port
  76. The remote port number of the most recently done connection (Added in 7.29.0)
  77. .TP
  78. .B scheme
  79. The URL scheme (sometimes called protocol) that was effectively used (Added in 7.52.0)
  80. .TP
  81. .B size_download
  82. The total amount of bytes that were downloaded.
  83. .TP
  84. .B size_header
  85. The total amount of bytes of the downloaded headers.
  86. .TP
  87. .B size_request
  88. The total amount of bytes that were sent in the HTTP request.
  89. .TP
  90. .B size_upload
  91. The total amount of bytes that were uploaded.
  92. .TP
  93. .B speed_download
  94. The average download speed that curl measured for the complete download. Bytes
  95. per second.
  96. .TP
  97. .B speed_upload
  98. The average upload speed that curl measured for the complete upload. Bytes per
  99. second.
  100. .TP
  101. .B ssl_verify_result
  102. The result of the SSL peer certificate verification that was requested. 0
  103. means the verification was successful. (Added in 7.19.0)
  104. .TP
  105. .B stderr
  106. From this point on, the --write-out output will be written to standard
  107. error. (Added in 7.63.0)
  108. .TP
  109. .B stdout
  110. From this point on, the --write-out output will be written to standard output.
  111. This is the default, but can be used to switch back after switching to stderr.
  112. (Added in 7.63.0)
  113. .TP
  114. .B time_appconnect
  115. The time, in seconds, it took from the start until the SSL/SSH/etc
  116. connect/handshake to the remote host was completed. (Added in 7.19.0)
  117. .TP
  118. .B time_connect
  119. The time, in seconds, it took from the start until the TCP connect to the
  120. remote host (or proxy) was completed.
  121. .TP
  122. .B time_namelookup
  123. The time, in seconds, it took from the start until the name resolving was
  124. completed.
  125. .TP
  126. .B time_pretransfer
  127. The time, in seconds, it took from the start until the file transfer was just
  128. about to begin. This includes all pre-transfer commands and negotiations that
  129. are specific to the particular protocol(s) involved.
  130. .TP
  131. .B time_redirect
  132. The time, in seconds, it took for all redirection steps including name lookup,
  133. connect, pretransfer and transfer before the final transaction was
  134. started. time_redirect shows the complete execution time for multiple
  135. redirections. (Added in 7.12.3)
  136. .TP
  137. .B time_starttransfer
  138. The time, in seconds, it took from the start until the first byte was just
  139. about to be transferred. This includes time_pretransfer and also the time the
  140. server needed to calculate the result.
  141. .TP
  142. .B time_total
  143. The total time, in seconds, that the full operation lasted.
  144. .TP
  145. .B url_effective
  146. The URL that was fetched last. This is most meaningful if you've told curl
  147. to follow location: headers.
  148. .RE
  149. .IP
  150. If this option is used several times, the last one will be used.