blob: cdd3ca6bd02baa89673c2ac941d33f3a225198f9 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001Long: quote
2Short: Q
3Help: Send command(s) to server before transfer
4Protocols: FTP SFTP
5---
6
7Send an arbitrary command to the remote FTP or SFTP server. Quote commands are
8sent BEFORE the transfer takes place (just after the initial PWD command in an
9FTP transfer, to be exact). To make commands take place after a successful
10transfer, prefix them with a dash '-'. To make commands be sent after curl
11has changed the working directory, just before the transfer command(s), prefix
12the command with a '+' (this is only supported for FTP). You may specify any
13number of commands.
14
15If the server returns failure for one of the commands, the entire operation
16will be aborted. You must send syntactically correct FTP commands as RFC 959
17defines to FTP servers, or one of the commands listed below to SFTP servers.
18
19This option can be used multiple times. When speaking to an FTP server, prefix
20the command with an asterisk (*) to make curl continue even if the command
21fails as by default curl will stop at first failure.
22
23SFTP is a binary protocol. Unlike for FTP, curl interprets SFTP quote commands
24itself before sending them to the server. File names may be quoted
25shell-style to embed spaces or special characters. Following is the list of
26all supported SFTP quote commands:
27.RS
28.IP "chgrp group file"
29The chgrp command sets the group ID of the file named by the file operand to
30the group ID specified by the group operand. The group operand is a decimal
31integer group ID.
32.IP "chmod mode file"
33The chmod command modifies the file mode bits of the specified file. The
34mode operand is an octal integer mode number.
35.IP "chown user file"
36The chown command sets the owner of the file named by the file operand to the
37user ID specified by the user operand. The user operand is a decimal
38integer user ID.
39.IP "ln source_file target_file"
40The ln and symlink commands create a symbolic link at the target_file location
41pointing to the source_file location.
42.IP "mkdir directory_name"
43The mkdir command creates the directory named by the directory_name operand.
44.IP "pwd"
45The pwd command returns the absolute pathname of the current working directory.
46.IP "rename source target"
47The rename command renames the file or directory named by the source
48operand to the destination path named by the target operand.
49.IP "rm file"
50The rm command removes the file specified by the file operand.
51.IP "rmdir directory"
52The rmdir command removes the directory entry specified by the directory
53operand, provided it is empty.
54.IP "symlink source_file target_file"
55See ln.
56.RE