2022-06-14 06:12:03 +08:00
|
|
|
c: Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
|
|
|
|
SPDX-License-Identifier: curl
|
2016-11-16 21:20:36 +08:00
|
|
|
Long: remote-name
|
|
|
|
Short: O
|
|
|
|
Help: Write output to a file named as the remote file
|
2020-07-13 20:15:04 +08:00
|
|
|
Category: important output
|
2021-08-31 22:37:14 +08:00
|
|
|
Example: -O https://example.com/filename
|
2021-09-28 17:50:07 +08:00
|
|
|
Added: 4.0
|
2022-06-01 06:33:17 +08:00
|
|
|
See-also: remote-name-all output-dir remote-header-name
|
2022-10-18 16:39:43 +08:00
|
|
|
Multi: append
|
2016-11-16 21:20:36 +08:00
|
|
|
---
|
|
|
|
Write output to a local file named like the remote file we get. (Only the file
|
|
|
|
part of the remote file is used, the path is cut off.)
|
|
|
|
|
|
|
|
The file will be saved in the current working directory. If you want the file
|
|
|
|
saved in a different directory, make sure you change the current working
|
2022-06-01 06:33:17 +08:00
|
|
|
directory before invoking curl with this option or use --output-dir.
|
2016-11-16 21:20:36 +08:00
|
|
|
|
|
|
|
The remote file name to use for saving is extracted from the given URL,
|
|
|
|
nothing else, and if it already exists it will be overwritten. If you want the
|
|
|
|
server to be able to choose the file name refer to --remote-header-name which
|
|
|
|
can be used in addition to this option. If the server chooses a file name and
|
|
|
|
that name already exists it will not be overwritten.
|
|
|
|
|
|
|
|
There is no URL decoding done on the file name. If it has %20 or other URL
|
|
|
|
encoded parts of the name, they will end up as-is as file name.
|
|
|
|
|
|
|
|
You may use this option as many times as the number of URLs you have.
|