| 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: quote | 
|  | 4 | Arg: <command> | 
|  | 5 | Short: Q | 
|  | 6 | Help: Send command(s) to server before transfer | 
|  | 7 | Protocols: FTP SFTP | 
|  | 8 | Category: ftp sftp | 
|  | 9 | Example: --quote "DELE file" ftp://example.com/foo | 
|  | 10 | Added: 5.3 | 
|  | 11 | See-also: request | 
|  | 12 | Multi: append | 
|  | 13 | --- | 
|  | 14 | Send an arbitrary command to the remote FTP or SFTP server. Quote commands are | 
|  | 15 | sent BEFORE the transfer takes place (just after the initial PWD command in an | 
|  | 16 | FTP transfer, to be exact). To make commands take place after a successful | 
|  | 17 | transfer, prefix them with a dash '-'. | 
|  | 18 |  | 
|  | 19 | (FTP only) To make commands be sent after curl has changed the working | 
|  | 20 | directory, just before the file transfer command(s), prefix the command with a | 
|  | 21 | '+'. This is not performed when a directory listing is performed. | 
|  | 22 |  | 
|  | 23 | You may specify any number of commands. | 
|  | 24 |  | 
|  | 25 | By default curl will stop at first failure. To make curl continue even if the | 
|  | 26 | command fails, prefix the command with an asterisk (*). Otherwise, if the | 
|  | 27 | server returns failure for one of the commands, the entire operation will be | 
|  | 28 | aborted. | 
|  | 29 |  | 
|  | 30 | You must send syntactically correct FTP commands as RFC 959 defines to FTP | 
|  | 31 | servers, or one of the commands listed below to SFTP servers. | 
|  | 32 |  | 
|  | 33 | This option can be used multiple times. | 
|  | 34 |  | 
|  | 35 | SFTP is a binary protocol. Unlike for FTP, curl interprets SFTP quote commands | 
|  | 36 | itself before sending them to the server. File names may be quoted | 
|  | 37 | shell-style to embed spaces or special characters. Following is the list of | 
|  | 38 | all supported SFTP quote commands: | 
|  | 39 | .RS | 
|  | 40 | .IP "atime date file" | 
|  | 41 | The atime command sets the last access time of the file named by the file | 
|  | 42 | operand. The <date expression> can be all sorts of date strings, see the | 
|  | 43 | *curl_getdate(3)* man page for date expression details. (Added in 7.73.0) | 
|  | 44 | .IP "chgrp group file" | 
|  | 45 | The chgrp command sets the group ID of the file named by the file operand to | 
|  | 46 | the group ID specified by the group operand. The group operand is a decimal | 
|  | 47 | integer group ID. | 
|  | 48 | .IP "chmod mode file" | 
|  | 49 | The chmod command modifies the file mode bits of the specified file. The | 
|  | 50 | mode operand is an octal integer mode number. | 
|  | 51 | .IP "chown user file" | 
|  | 52 | The chown command sets the owner of the file named by the file operand to the | 
|  | 53 | user ID specified by the user operand. The user operand is a decimal | 
|  | 54 | integer user ID. | 
|  | 55 | .IP "ln source_file target_file" | 
|  | 56 | The ln and symlink commands create a symbolic link at the target_file location | 
|  | 57 | pointing to the source_file location. | 
|  | 58 | .IP "mkdir directory_name" | 
|  | 59 | The mkdir command creates the directory named by the directory_name operand. | 
|  | 60 | .IP "mtime date file" | 
|  | 61 | The mtime command sets the last modification time of the file named by the | 
|  | 62 | file operand. The <date expression> can be all sorts of date strings, see the | 
|  | 63 | *curl_getdate(3)* man page for date expression details. (Added in 7.73.0) | 
|  | 64 | .IP "pwd" | 
|  | 65 | The pwd command returns the absolute pathname of the current working directory. | 
|  | 66 | .IP "rename source target" | 
|  | 67 | The rename command renames the file or directory named by the source | 
|  | 68 | operand to the destination path named by the target operand. | 
|  | 69 | .IP "rm file" | 
|  | 70 | The rm command removes the file specified by the file operand. | 
|  | 71 | .IP "rmdir directory" | 
|  | 72 | The rmdir command removes the directory entry specified by the directory | 
|  | 73 | operand, provided it is empty. | 
|  | 74 | .IP "symlink source_file target_file" | 
|  | 75 | See ln. | 
|  | 76 | .RE |