Debian下使用curl操作ftp上传和下载
1.文件上传
curl --ftp-create-dirs -T ./main.py ftp://test:testpasswd123123@45.x.x.136/main.py
--ftp-create-dirs 代表在ftp上自动创建目标文件夹。
-T 上传文件 ftp目标路径: ftp://test:testpasswd123123@45.x.x.136/ test是ftp用户名 testpasswd123123是ftp密码,需要注意密码中包含特殊字符时需要转码 2.文件下载 查看目录下面的文件
curl ftp://username:password@192.168.10.91:21/ 最后一定要加斜杠“/”,否则报错
下载文件到本地 curl ftp://test:testpasswd123123@45.x.x.136/main.go -o main.go.bak
这里用到的参数是 -o,注意参数位置,不在最前面。
版权保护: 本文「Debian下使用curl操作ftp上传和下载」由 云主机配置专家 原创,转载请保留链接: https://www.miandns.com/docs/system/342.html