1 c: Copyright (C) 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 16 in an FTP transfer, to be exact). To make commands take place after a 17 successful 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 stops 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 is 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 SFTP is a binary protocol. Unlike for FTP, curl interprets SFTP quote commands 34 itself before sending them to the server. File names may be quoted 35 shell-style to embed spaces or special characters. Following is the list of 36 all supported SFTP quote commands: 37 .RS 38 .TP 39 **"atime date file"** 40 The atime command sets the last access time of the file named by the file 41 operand. The <date expression> can be all sorts of date strings, see the 42 *curl_getdate(3)* man page for date expression details. (Added in 7.73.0) 43 .TP 44 **"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 .TP 49 **"chmod mode file"** 50 The chmod command modifies the file mode bits of the specified file. The 51 mode operand is an octal integer mode number. 52 .TP 53 **"chown user file"** 54 The chown command sets the owner of the file named by the file operand to the 55 user ID specified by the user operand. The user operand is a decimal 56 integer user ID. 57 .TP 58 **"ln source_file target_file"** 59 The ln and symlink commands create a symbolic link at the target_file location 60 pointing to the source_file location. 61 .TP 62 **"mkdir directory_name"** 63 The mkdir command creates the directory named by the directory_name operand. 64 .TP 65 **"mtime date file"** 66 The mtime command sets the last modification time of the file named by the 67 file operand. The <date expression> can be all sorts of date strings, see the 68 *curl_getdate(3)* man page for date expression details. (Added in 7.73.0) 69 .TP 70 **"pwd"** 71 The pwd command returns the absolute path name of the current working directory. 72 .TP 73 **"rename source target"** 74 The rename command renames the file or directory named by the source 75 operand to the destination path named by the target operand. 76 .TP 77 **"rm file"** 78 The rm command removes the file specified by the file operand. 79 .TP 80 **"rmdir directory"** 81 The rmdir command removes the directory entry specified by the directory 82 operand, provided it is empty. 83 .TP 84 **"symlink source_file target_file"** 85 See ln. 86 .RE 87 .IP 88