Debian下使用curl操作ftp上傳和下載
1.文件上傳
curl --ftp-create-dirs -T ./main.py ftp://test:testpasswd123123@45.x.x.136/main.py
--ftp-create-dirs 代表在ftp上自動(dòng)創(chuàng)建目標(biāo)文件夾。
-T 上傳文件 ftp目標(biāo)路徑: ftp://test:testpasswd123123@45.x.x.136/ test是ftp用戶名 testpasswd123123是ftp密碼,需要注意密碼中包含特殊字符時(shí)需要轉(zhuǎn)碼 2.文件下載 查看目錄下面的文件
curl ftp://username:password@192.168.10.91:21/ 最后一定要加斜杠“/”,否則報(bào)錯(cuò)
下載文件到本地 curl ftp://test:testpasswd123123@45.x.x.136/main.go -o main.go.bak
這里用到的參數(shù)是 -o,注意參數(shù)位置,不在最前面。
版權(quán)保護(hù): 本文「Debian下使用curl操作ftp上傳和下載」由 云主機(jī)配置專家 原創(chuàng),轉(zhuǎn)載請(qǐng)保留鏈接: http://www.iqcg.cn/docs/system/342.html