- 输入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才能传多个文件 |
posted on
浙公网安备 33010602011771号