ubuntu通過ftp向小米手機傳輸多個檔案
阿新 • • 發佈:2021-06-13
輸入ftp命令,連線手機
root@wanboo-Inspiron-5570:~# ftp 192.168.1.104 2121
Connected to 192.168.1.104.
220 SwiFTP 4.1.4 ready
Name (192.168.1.104:root): wanboo
331 Send password
Password:
230 Access granted
Remote system type is UNIX.
Using binary mode to transfer files.
這下面的兩個轉換路徑必須做否則會出現如下錯誤
local: /media/shuai/xxx.mp3 remote: /media/shuai/xxx.mp3
421 Service not available, remote server has closed connection
在互動模式下輸入cd,切換到手機裡的資料夾位置
ftp> cd bluetooth
250 CWD successful
ftp> pwd
257 "/bluetooth"
輸入lcd切換到Ubuntu的位置
ftp> lcd /home/wanboo/視訊/mp4/
Local directory now /home/wanboo/視訊/mp4
傳輸檔案
ftp> put 如同悲傷被下載了兩次.mp4 local: 如同悲傷被下載了兩次.mp4 remote: 如同悲傷被下載了兩次.mp4 200 PORT OK 150 Data socket ready 226 Transmission complete 36433472 bytes sent in 49.39 secs (720.4086 kB/s)
這樣檔案就傳輸成功了。
- 問題1: put 只能傳單個檔案,但檔名不能使用萬用字元。
解決方法: 改用mput命令。 - 問題2: mput 可以傳多個檔案,但檔案總是少一個。
解決方法: 關閉主動模式後解決prompt off。
引數說明:
命令 | 作用 |
---|---|
binary | 二進位制模式傳輸 |
prompt off | 關閉主動模式 |
put | 只能上傳單個檔案 |
mput | 可以上傳多個檔案,檔案中可以包含萬用字元。必須設定為關閉主動模式,mput才能傳多個檔案 |