命令详解计划

2021-08-24 淮安装修公司

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

ftp命令使用Sample

-bash-3.00$ ftp (连接另外一台主机)

Connected to (139.185.21.141)。

220 (vsFTPd 1.2.1)

Name (: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 524 Aug 08 00:37 t

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 524 Aug 08 00:37 t

226 Directory send OK.

栽得梧桐树 ftp get t(从另一台主机往本地下载文件)

local: t remote: t

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

150 Opening BINARY mode data connection for t (524 bytes)。

226 File send OK.

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

ftp put x_bk(从本机往另外一台主机上传文件)

local: x_bk remote: x_bk

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

150 FILE: x_bk.1

226 File receive OK.

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

ftp bye(退出)

221 Goodbye.

命令详解

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:\\rose\\p,则

ftp get /rose/p p (回车)

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]

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

如要把本地的p传送到远端主机E:\\rose,并改名为p

ftp put p /rose/p (回车)

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 (回车)

南宁治疗盆腔炎哪家好
南通阳痿治疗费用多少钱
南昌哪里治疗男科
为你推荐