output
Specifies a file where you want a command to
write the output if the command executes successfully. If you do not specify
the
{--output | -o}
option, the command writes the output to the console.
Syntax
--output | -o file
Arguments
| Argument | Description |
|---|---|
file
|
Specifies the file
where you want the output written. If the file you specify does not exist, the
command creates it. You can specify:
|
Usage Notes
- If the file you specify with the
{--output | -o}option already exists, the command overwrites the existing file with the new service results. - If a command results in an error, the command
writers the error output to the location specified by the
{--error | -r}option or the console if the{--error | -r}option is not specified.
Examples
- To write output to a file named “results.xml”
in the directory c:\outputs:
--output c:\outputs\results.xml - To write output to a file named
“results.json” in the \outputs directory relative to where you initiate the
command:
--output outputs\results.json - To write output to a file named “results” in
the same directory from where you initiate the command:
--output resultsIn this example, the command determines the file extension based on the request content type.