在ftp下通过binary命令来传输二进制文件

系统环境:一台win7为FTP服务器(用的Filezilla Server),另一台VMware中的RHEL-6是FTP客户端,现在需要将FTP服务器上的google-chrome-stable_current_i386.rpm传输到RHEL-6中。

[root@RHEL-min huage]# ftp 192.168.1.16

Connected to 192.168.1.16 (192.168.1.16).

220 This is the share server that created by huage.

Name (192.168.1.16:huage): admin

331 Password required for admin

Password:

230 Logged on

Remote system type is UNIX. //这是由filezilla反馈的

ftp> dir

227 Entering Passive Mode (192,168,1,16,221,148) //Passive Mode

150 Connection accepted

drwxr-xr-x 1 ftp ftp 0 May 25 08:22 C

drwxr-xr-x 1 ftp ftp 0 May 26 2011 D

drwxr-xr-x 1 ftp ftp 0 May 19 11:03 $RECYCLE.BIN

drwxr-xr-x 1 ftp ftp 0 May 25 10:59 Desktop

drwxr-xr-x 1 ftp ftp 0 May 20 14:25 Documents

drwxr-xr-x 1 ftp ftp 0 May 23 11:48 FTP

-r–r--r-- 1 ftp ftp 31847404 May 25 14:16 google-chrome-stable_current_i386.rpm

drwxr-xr-x 1 ftp ftp 0 May 20 15:27 share

drwxr-xr-x 1 ftp ftp 0 May 19 17:26 System Volume Information

226 Transfer OK

ftp> binary //使用binary的方式来传输文件

200 Type set to I

ftp> get google-chrome-stable_current_i386.rpm

local: google-chrome-stable_current_i386.rpm remote: google-chrome-stable_current_i386.rpm

227 Entering Passive Mode (192,168,1,16,221,150)

150 Connection accepted

226 Transfer OK

31847404 bytes received in 4.04 secs (7887.90 Kbytes/sec)

ftp>

如果在get chrome前不用binary命令讲传输模式设为二进制的话,则会按默认的ASCII方式传输,最终得到的将是一个损坏了的rpm文件。

注:需要使用binary方式传输的文件类型有ISO文件、可执行文件、压缩文件、图片等。
转至博客:http://blog.sina.com.cn/s/blog_716844910100ssif.html

你可能感兴趣的:(LInux)