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