Linux ftp 命令

时间:2025-03-24 08:52:05
[deepen@vd26wyjl01 ~]$ ftp IP地址
Connected to .191 (10.xxxx191).
220-FileZilla Server 0.9.53 beta
220-written by Tim Kosse (@)
220 Please visit /
Name (.191:deepen): yzcloud
331 Password required for yzcloud
Password:
230 Logged on

Remote system type is UNIX.


--遍历文件

ftp> ls
227 Entering Passive Mode (xxxxxxx)
150 Opening data channel for directory listing of "/"
-rw-r--r-- 1 ftp ftp        7404450 May 25  2017
-rw-r--r-- 1 ftp ftp        7521933 Jun 02  2017

-rw-r--r-- 1 ftp ftp       15738963 Jun 05  2017


  1. ftp> binary  // 设置传输方式为binary  


在下载一个文件之前,我们首先需要使用lcd命令设定本地接受目录位置。

ftp> lcd /data/dt3/


ftp> get


使用 put命令上传文件:

put  file
当文件不再当前本地目录下的时候,可以使用绝对路径:

put /path/file
同样,可以上传多个文件:

mput *.xls
 

关闭 FTP 连接


完成FTP工作后,为了安全起见需要关闭连接。有三个命令可以关闭连接:

bye
exit
quit