xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame^] | 1 | c: Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al. |
| 2 | SPDX-License-Identifier: curl |
| 3 | Long: remote-name |
| 4 | Short: O |
| 5 | Help: Write output to a file named as the remote file |
| 6 | Category: important output |
| 7 | Example: -O https://example.com/filename |
| 8 | Added: 4.0 |
| 9 | See-also: remote-name-all output-dir remote-header-name |
| 10 | Multi: append |
| 11 | --- |
| 12 | Write output to a local file named like the remote file we get. (Only the file |
| 13 | part of the remote file is used, the path is cut off.) |
| 14 | |
| 15 | The file will be saved in the current working directory. If you want the file |
| 16 | saved in a different directory, make sure you change the current working |
| 17 | directory before invoking curl with this option or use --output-dir. |
| 18 | |
| 19 | The remote file name to use for saving is extracted from the given URL, |
| 20 | nothing else, and if it already exists it will be overwritten. If you want the |
| 21 | server to be able to choose the file name refer to --remote-header-name which |
| 22 | can be used in addition to this option. If the server chooses a file name and |
| 23 | that name already exists it will not be overwritten. |
| 24 | |
| 25 | There is no URL decoding done on the file name. If it has %20 or other URL |
| 26 | encoded parts of the name, they will end up as-is as file name. |
| 27 | |
| 28 | You may use this option as many times as the number of URLs you have. |