Linux系统通过命令使用FTP的详细方法(图)

原标题:"Linux系统通过命令使用FTP的详细方法"相关电脑问题教程分享。 - 来源:编程之家。

众所周知,Linux系统下使用FTP,连接FTP服务器、上传文件、下载文件都是通过命令来完成的,但是很多用户不知道如何操作,下面我们一起来看看Linux系统通过命令使用FTP的详细方法。

Linux系统

ftp命令使用Sample

-bash-3.00$ ftp rws60001rems.us.oracle.com(连接另外一台主机)

Connected to rws60001rems.us.oracle.com (139.185.21.141)。

220 (vsFTPd 1.2.1)

Name (rws60001rems.us.oracle.com:app7740): xxxxx

331 Please specify the password.

Password:

230 Login successful.

Remote system type is UNIX.

Using binary mode to transfer files.

ftp》 ls

227 Entering Passive Mode (139,185,21,141,216,189)

150 Here comes the directory listing.

-rw-r--r-- 1 60202384 60402384 524 Aug 08 00:37 temp1.out

226 Directory send OK.

ftp》 pwd(ftp命令下也可以执行普通的linux命令,pwd,ls,cd…)

257 “/slot/ems2384/appmgr”

ftp》 ls temp1*

227 Entering Passive Mode (139,185,21,141,178,113)

150 Here comes the directory listing.

-rw-r--r-- 1 60202384 60402384 524 Aug 08 00:37 temp1.out

226 Directory send OK.

ftp》 get temp1.out(从另一台主机往本地下载文件)

local: temp1.out remote: temp1.out

227 Entering Passive Mode (139,185,21,141,126,148)

150 Opening BINARY mode data connection for temp1.out (524 bytes)。

226 File send OK.

524 bytes received in 0.0017 secs (3e 02 Kbytes/sec)

ftp》 put INVLTENT.plx_bk(从本机往另外一台主机上传文件)

local: INVLTENT.plx_bk remote: INVLTENT.plx_bk

227 Entering Passive Mode (139,185,21,141,109,145)

150 FILE: INVLTENT.plx_bk.1

226 File receive OK.

331776 bytes sent in 0.00457 secs (7.1e 04 Kbytes/sec)

ftp》 bye(退出)

221 Goodbye.


[page]

FTP命令详解

1. 连接ftp服务器

格式:ftp [hostname| ip-address]

a)在linux命令行下输入:ftp 10.18.34.115

b)服务器询问你用户名和口令,分别输入yint和相应密码,待认证通过即可。

2. 下载文件

下载文件通常用get和mget这两条命令。

a) get

格式:get [remote-file] [local-file]

将文件从远端主机中传送至本地主机中。

如要获取服务器上E:rose1.bmp,则

ftp》 get /rose/1.bmp 1.bmp (回车)

b) mget

格式:mget [remote-files]

从远端主机接收一批文件至本地主机。

如要获取服务器上E:rose下的所有文件,则

ftp》 cd /rose

ftp》 mget *.* (回车)

注意:文件都下载到了linux主机的当前目录下。比如,在 /root/yint下运行的ftp命令,则文件都下载到了/root/yint下。

3.上传文件

a) put

格式:put local-file [remote-file]

将本地一个文件传送至远端主机中。

如要把本地的1.bmp传送到远端主机E:rose,并改名为333.bmp

ftp》 put 1.bmp /rose/333.bmp (回车)

b) mput

格式:mput local-files

将本地主机中一批文件传送至远端主机。

如要把本地当前目录下所有bmp文件上传到服务器E:rose 下

ftp》 cd /rose (回车)

ftp》 mput *.bmp (回车)

注意:上传文件都来自于主机的当前目录下。比如,在 /root/yint下运行的ftp命令,则只有在/root/yint下的文件linux才会上传到服务器E:rose 下。

4. 断开连接

bye:中断与服务器的连接。

ftp》 bye (回车)

以上就是Linux系统通过命令使用FTP的详细方法

相关文章

有系统u盘要网络吗(有系统u盘要网络吗怎么连接)想要重新系统...
u盘识别盘符不能格式化(u盘无法识别需要格式化)因为重装系统...
u盘错误无法读取(u盘错误无法读取文件)U盘无法读取?出现这种...
电脑f2启动相应系统(电脑f2启动相应系统错误)开机后出现如下...
win7直接启动(win7直接启动admin)一共三种启动方式,针对台式...
近期有些win7用户反映说,自己的电脑使用过程中就出现了蓝屏...