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