首页
/
每日頭條
/
科技
/
linux創建ftp代碼
linux創建ftp代碼
更新时间:2025-03-01 10:48:48

FTP服務器大家都不陌生,文件傳輸協議,軟件有很多比如vsftpd、pureftp等,我習慣使用pureftp軟件,ftp的客戶端也有很多FILEZilla通常使用較多,關于ftp的傳輸有兩種,ASCII、二進制。在linux上一般使用二進制進行傳輸。

腳本内容:

#!/bin/sh

FILE = list.txt

ftp -v -n 192.168.1.1<<EOF #ftp地址

user ftpuser 123456 #ftp用戶名和密碼

binary #二進制文件傳輸

cd www/html #進入ftp目錄

lcd ./ #進入本地目錄

prompt #交互模式提示

put $FILE #上傳文件

bye #終止ftp進程

EOF

echo "Successful file transfer"

腳本執行效果:

linux創建ftp代碼(Shell腳本100例17使用腳本登錄ftp并上傳文件)1

linux創建ftp代碼(Shell腳本100例17使用腳本登錄ftp并上傳文件)2

,
Comments
Welcome to tft每日頭條 comments! Please keep conversations courteous and on-topic. To fosterproductive and respectful conversations, you may see comments from our Community Managers.
Sign up to post
Sort by
Show More Comments
Copyright 2023-2025 - www.tftnews.com All Rights Reserved