2
0

quote.d 3.2 KB

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