
1、查看是否安装vsftpd,如果没有用yum安装,本系统没有安装。
2、查看是否安装成功。
3、启动,stop关闭,restart重启。
4、在Windows下登录ftp,需要知道ip。
5、在空白处右键选择登录。
6、创建文件测试成功。
package comweixinutil;
import javaioFile;
import javaioFileOutputStream;
import javaioIOException;
import javaioInputStream;
import javaioOutputStream;
import javaioPrintWriter;
import javaioRandomAccessFile;
import orgapachecommonsnetPrintCommandListener;
import orgapachecommonsnetftpFTP;
import orgapachecommonsnetftpFTPClient;
import orgapachecommonsnetftpFTPFile;
import orgapachecommonsnetftpFTPReply;
import comweixinconstantDownloadStatus;
import comweixinconstantUploadStatus;
/
支持断点续传的FTP实用类
@version 01 实现基本断点上传下载
@version 02 实现上传下载进度汇报
@version 03 实现中文目录创建及中文文件创建,添加对于中文的支持
/
public class ContinueFTP {
public FTPClient ftpClient = new FTPClient();
public ContinueFTP(){
//设置将过程中使用到的命令输出到控制台
thisftpClientaddProtocolCommandListener(new PrintCommandListener(new PrintWriter(Systemout)));
}
/
连接到FTP服务器
@param hostname 主机名
@param port 端口
@param username 用户名
@param password 密码
@return 是否连接成功
@throws IOException
/
public boolean connect(String hostname,int port,String username,String password) throws IOException{
ftpClientconnect(hostname, port);
ftpClientsetControlEncoding("GBK");
if(FTPReplyisPositiveCompletion(ftpClientgetReplyCode())){
if(ftpClientlogin(username, password)){
return true;
}
}
disconnect();
return false;
}
/
从FTP服务器上下载文件,支持断点续传,上传百分比汇报
@param remote 远程文件路径
@param local 本地文件路径
@return 上传的状态
@throws IOException
/
public DownloadStatus download(String remote,String local) throws IOException{
//设置被动模式
ftpCliententerLocalPassiveMode();
//设置以二进制方式传输
ftpClientsetFileType(FTPBINARY_FILE_TYPE);
DownloadStatus result;
//检查远程文件是否存在
FTPFile[] files = ftpClientlistFiles(new String(remotegetBytes("GBK"),"iso-8859-1"));
if(fileslength != 1){
Systemoutprintln("远程文件不存在");
return DownloadStatusRemote_File_Noexist;
}
long lRemoteSize = files[0]getSize();
File f = new File(local);
//本地存在文件,进行断点下载
if(fexists()){
long localSize = flength();
//判断本地文件大小是否大于远程文件大小
if(localSize >= lRemoteSize){
Systemoutprintln("本地文件大于远程文件,下载中止");
return DownloadStatusLocal_Bigger_Remote;
}
//进行断点续传,并记录状态
FileOutputStream out = new FileOutputStream(f,true);
ftpClientsetRestartOffset(localSize);
InputStream in = ftpClientretrieveFileStream(new String(remotegetBytes("GBK"),"iso-8859-1"));
byte[] bytes = new byte[1024];
long step = lRemoteSize /100;
long process=localSize /step;
int c;
while((c = inread(bytes))!= -1){
outwrite(bytes,0,c);
localSize+=c;
long nowProcess = localSize /step;
if(nowProcess > process){
process = nowProcess;
if(process % 10 == 0)
Systemoutprintln("下载进度:"+process);
//TODO 更新文件下载进度,值存放在process变量中
}
}
inclose();
outclose();
boolean isDo = ftpClientcompletePendingCommand();
if(isDo){
result = DownloadStatusDownload_From_Break_Success;
}else {
result = DownloadStatusDownload_From_Break_Failed;
}
}else {
OutputStream out = new FileOutputStream(f);
InputStream in= ftpClientretrieveFileStream(new String(remotegetBytes("GBK"),"iso-8859-1"));
byte[] bytes = new byte[1024];
long step = lRemoteSize /100;
long process=0;
long localSize = 0L;
int c;
while((c = inread(bytes))!= -1){
outwrite(bytes, 0, c);
localSize+=c;
long nowProcess = localSize /step;
if(nowProcess > process){
process = nowProcess;
if(process % 10 == 0)
Systemoutprintln("下载进度:"+process);
//TODO 更新文件下载进度,值存放在process变量中
}
}
inclose();
outclose();
boolean upNewStatus = ftpClientcompletePendingCommand();
if(upNewStatus){
result = DownloadStatusDownload_New_Success;
}else {
result = DownloadStatusDownload_New_Failed;
}
}
return result;
}
/
上传文件到FTP服务器,支持断点续传
@param local 本地文件名称,绝对路径
@param remote 远程文件路径,使用/home/directory1/subdirectory/fileext 按照Linux上的路径指定方式,支持多级目录嵌套,支持递归创建不存在的目录结构
@return 上传结果
@throws IOException
/
public UploadStatus upload(String local,String remote) throws IOException{
//设置PassiveMode传输
ftpCliententerLocalPassiveMode();
//设置以二进制流的方式传输
ftpClientsetFileType(FTPBINARY_FILE_TYPE);
ftpClientsetControlEncoding("GBK");
UploadStatus result;
//对远程目录的处理
String remoteFileName = remote;
if(remotecontains("/")){
remoteFileName = remotesubstring(remotelastIndexOf("/")+1);
//创建服务器远程目录结构,创建失败直接返回
if(CreateDirecroty(remote, ftpClient)==UploadStatusCreate_Directory_Fail){
return UploadStatusCreate_Directory_Fail;
}
}
//检查远程是否存在文件
FTPFile[] files = ftpClientlistFiles(new String(remoteFileNamegetBytes("GBK"),"iso-8859-1"));
if(fileslength == 1){
long remoteSize = files[0]getSize();
File f = new File(local);
long localSize = flength();
if(remoteSize==localSize){
return UploadStatusFile_Exits;
}else if(remoteSize > localSize){
return UploadStatusRemote_Bigger_Local;
}
//尝试移动文件内读取指针,实现断点续传
result = uploadFile(remoteFileName, f, ftpClient, remoteSize);
//如果断点续传没有成功,则删除服务器上文件,重新上传
if(result == UploadStatusUpload_From_Break_Failed){
if(!ftpClientdeleteFile(remoteFileName)){
return UploadStatusDelete_Remote_Faild;
}
result = uploadFile(remoteFileName, f, ftpClient, 0);
}
}else {
result = uploadFile(remoteFileName, new File(local), ftpClient, 0);
}
return result;
}
/
断开与远程服务器的连接
@throws IOException
/
public void disconnect() throws IOException{
if(ftpClientisConnected()){
ftpClientdisconnect();
}
}
/
递归创建远程服务器目录
@param remote 远程服务器文件绝对路径
@param ftpClient FTPClient对象
@return 目录创建是否成功
@throws IOException
/
public UploadStatus CreateDirecroty(String remote,FTPClient ftpClient) throws IOException{
UploadStatus status = UploadStatusCreate_Directory_Success;
String directory = remotesubstring(0,remotelastIndexOf("/")+1);
if(!directoryequalsIgnoreCase("/")&&!ftpClientchangeWorkingDirectory(new String(directorygetBytes("GBK"),"iso-8859-1"))){
//如果远程目录不存在,则递归创建远程服务器目录
int start=0;
int end = 0;
if(directorystartsWith("/")){
start = 1;
}else{
start = 0;
}
end = directoryindexOf("/",start);
while(true){
String subDirectory = new String(remotesubstring(start,end)getBytes("GBK"),"iso-8859-1");
if(!ftpClientchangeWorkingDirectory(subDirectory)){
if(ftpClientmakeDirectory(subDirectory)){
ftpClientchangeWorkingDirectory(subDirectory);
}else {
Systemoutprintln("创建目录失败");
return UploadStatusCreate_Directory_Fail;
}
}
start = end + 1;
end = directoryindexOf("/",start);
//检查所有目录是否创建完毕
if(end <= start){
break;
}
}
}
return status;
}
/
上传文件到服务器,新上传和断点续传
@param remoteFile 远程文件名,在上传之前已经将服务器工作目录做了改变
@param localFile 本地文件File句柄,绝对路径
@param processStep 需要显示的处理进度步进值
@param ftpClient FTPClient引用
@return
@throws IOException
/
public UploadStatus uploadFile(String remoteFile,File localFile,FTPClient ftpClient,long remoteSize) throws IOException{
UploadStatus status;
//显示进度的上传
long step = localFilelength() / 100;
long process = 0;
long localreadbytes = 0L;
RandomAccessFile raf = new RandomAccessFile(localFile,"r");
OutputStream out = ftpClientappendFileStream(new String(remoteFilegetBytes("GBK"),"iso-8859-1"));
//断点续传
if(remoteSize>0){
ftpClientsetRestartOffset(remoteSize);
process = remoteSize /step;
rafseek(remoteSize);
localreadbytes = remoteSize;
}
byte[] bytes = new byte[1024];
int c;
while((c = rafread(bytes))!= -1){
outwrite(bytes,0,c);
localreadbytes+=c;
if(localreadbytes / step != process){
process = localreadbytes / step;
Systemoutprintln("上传进度:" + process);
//TODO 汇报上传状态
}
}
outflush();
rafclose();
outclose();
boolean result =ftpClientcompletePendingCommand();
if(remoteSize > 0){
status = resultUploadStatusUpload_From_Break_Success:UploadStatusUpload_From_Break_Failed;
}else {
status = resultUploadStatusUpload_New_File_Success:UploadStatusUpload_New_File_Failed;
}
return status;
}
public static void main(String[] args) {
ContinueFTP myFtp = new ContinueFTP();
try {
Systemerrprintln(myFtpconnect("10106236", 21, "5", "jieyan"));
// myFtpftpClientmakeDirectory(new String("歌曲"getBytes("GBK"),"iso-8859-1"));
// myFtpftpClientchangeWorkingDirectory(new String("歌曲"getBytes("GBK"),"iso-8859-1"));
// myFtpftpClientmakeDirectory(new String("爱你等于爱自己"getBytes("GBK"),"iso-8859-1"));
// Systemoutprintln(myFtpupload("E:\\ywflv", "/ywflv",5));
// Systemoutprintln(myFtpupload("E:\\爱你等于爱自己mp4","/爱你等于爱自己mp4"));
//Systemoutprintln(myFtpdownload("/爱你等于爱自己mp4", "E:\\爱你等于爱自己mp4"));
myFtpdisconnect();
} catch (IOException e) {
Systemoutprintln("连接FTP出错:"+egetMessage());
}
}
}
1、DOS方式下FTP的使用
可在Windows系统cmd命令提示符下,输入
C: >FTP 域名
USER NAME: 管理员帐号
PASSWORD: 口令
FTP>PUT
LOCAL FILE: filename
REMOTE FILE: filename
即可上传
下载时使用GET命令
2、FTP常用命令
Ftp命令的功能是在本地机和远程机之间传送文件。该命令的一般格式如下:
c:> ftp 主机名/IP
最常用的命令有:
ls 列出远程机的当前目录
cd 在远程机上改变工作目录
lcd 在本地机上改变工作目录
ascii 设置文件传输方式为ASCII模式
binary 设置文件传输方式为二进制模式
close 终止当前的ftp会话
hash 每次传输完数据缓冲区中的数据后就显示一个#号
get(mget) 从远程机传送指定文件到本地机
put(mput) 从本地机传送指定文件到远程机
open 连接远程ftp站点
quit 断开与远程机的连接并退出ftp
? 显示本地帮助信息
3Linux下FTP命令详解
FTP> ! 从 ftp 子系统退出到外壳。
FTP> 显示 ftp 命令说明。 与 help 相同。
格式: [command]
说明:[command]指定需要帮助的命令名称。如果没有指定 command,ftp 将显示全部命令的列表。
FTP> append 使用当前文件类型设置将本地文件附加到远程计算机上的文件。
格式:append local-file [remote-file]
说明:local-file 指定要添加的本地文件。
remote-file 指定要添加 local-file 的远程计算机上的文件。如果省略了 remote-file,本地文件名将被用作远程文件名。
FTP> ascii 将文件传送类型设置为默认的 ASCII。
说明:FTP 支持两种文件传送类型,ASCII 码和二进制图像。在传送文本文件时应该使用ASCII。
FTP> bell 切换响铃以在每个文件传送命令完成后响铃。默认情况下,铃声是关闭的。
FTP> binary(或bi) 将文件传送类型设置为二进制。
FTP> bye(或by) 结束与远程计算机的 FTP 会话并退出 ftp。
FTP> cd 更改远程计算机上的工作目录。
格式:cd remote-directory
说明:remote-directory 指定要更改的远程计算机上的目录。
FTP> close 结束与远程服务器的 FTP 会话并返回命令解释程序。
FTP> debug 切换调试。当调试打开时,发送到远程计算机的每个命令都打印,前面是字符串“>”。默认情况下,调试是关闭的。
FTP> delete 删除远程计算机上的文件。
格式:delete remote-file
说明:remote-file 指定要删除的文件。
FTP> dir 显示远程目录文件和子目录列表。
格式:dir [remote-directory] [local-file]
说明:remote-directory 指定要查看其列表的目录。如果没有指定目录,将使用远程计算机中的当前工作目录。Local-file 指定要存储列表的本地文件。如果没有指定,输出将显示在屏幕上。
FTP> disconnect 从远程计算机断开,保留 ftp 提示。
FTP> get 使用当前文件转换类型将远程文件复制到本地计算机。
格式:get remote-file [local-file]
说明:remote-file 指定要复制的远程文件。
Local-file 指定要在本地计算机上使用的名称。如果没有指定,文件将命名为 remote-file。
FTP >glob 切换文件名组合。组合允许在内部文件或路径名中使用通配符(和)。默认情况下,组合是打开的。
FTP >hash 切换已传输的每个数据块的数字签名 (#) 打印。数据块的大小是2048 字节。默认情况下,散列符号打印是关闭的。
FTP >help 显示 ftp 命令说明。
格式:help [command]
说明:command 指定需要有关说明的命令的名称。如果没有指定 command,ftp 将显示全部命令的列表。
FTP >lcd 更改本地计算机上的工作目录。默认情况下,工作目录是启动 ftp 的目录。
格式:lcd [directory]
说明:directory 指定要更改的本地计算机上的目录。如果没有指定directory,将显示本地计算机中当前的工作目录。
FTP >literal 将参数逐字发送到远程 FTP 服务器。将返回单个的 FTP 回复代码。
格式:literal argument [ ]
说明:argument 指定要发送到 FTP 服务器的参数。
FTP >ls 显示远程目录文件和子目录的缩写列表。
格式:ls [remote-directory] [local-file]
说明:remote-directory 指定要查看其列表的目录。如果没有指定目录,将使用远程计算机中的当前工作目录。 local-file 指定要存储列表的本地文件。如果没有指定,输出将显示在屏幕上。
FTP >mdelete 删除远程计算机上的文件。
格式:mdelete remote-files [ ]
说明:remote-files 指定要删除的远程文件。
FTP >mdir 显示远程目录文件和子目录列表。可以使用 mdir 指定多个文件。
格式:mdir remote-files [ ] local-file
说明:remote-files 指定要查看列表的目录。必须指定 remote-files。请键入 - 使用远程计算机上的当前工作目录。
local-file 指定要还原列表的本地文件。请键入- 在屏幕上显示列表。
FTP >mget 使用当前文件传送类型将远程文件复制到本地计算机。
格式:mget remote-files [ ]
说明:remote-files 指定要复制到本地计算机的远程文件。
FTP >mkdir 创建远程目录。
格式:mkdir directory
说明:directory 指定新的远程目录的名称。
FTP >mls 显示远程目录文件和子目录的缩写列表。
格式:mls remote-files [ ] local-file
说明:remote-files 指定要查看列表的文件。必须指定 remote-files;
请键入- 使用远程计算机上的当前工作目录。
local-file 指定要存储列表的本地文件。请键入 - 以在屏幕上显示列表。
FTP >mput 使用当前文件传送类型将本地文件复制到远程计算机上。
格式:mput local-files [ ]
说明:local-files 指定要复制到远程计算机的本地文件
FTP >open 与指定的 FTP 服务器连接。
格式:open computer [port]
说明:computer 指定要连接的远程计算机。可以通过 IP 地址或计算机名称指定计算机(DNS 或主机文件必须可用)。如果自动登录打开(默认),ftp 还将尝试自动将用户登录到 FTP 服务器port 指定用来联系 FTP 服务器的端口号。
FTP >prompt 切换提示。如果关闭提示时 mget 及 mput 传送所有文件,Ftp在多文件传送过程中将提示允许您有选择地检索或存储文件。默认情况下,提示是
打开的。
FTP >put 使用当前文件传送类型将本地文件复制到远程计算机上。
格式:put local-file [remote-file]
说明:local-file 指定要复制的本地文件。
remote-file 指定要在远程计算机上使用的名称。如果没有指定,文件将命名为 local-file。
FTP >pwd 显示远程计算机上的当前目录。
FTP >quit 结束与远程计算机的 FTP 会话并退出 ftp。
FTP >quote 将参数逐字发送到远程 FTP 服务器。将返回单个的 FTP 回复代码。
Quote 与 literal 相同。
格式:quote argument [ ]
说明:argument 指定要发送到 FTP 服务器的参数。
FTP >recv 使用当前文件传送类型将远程文件复制到本地计算机。Recv 与 get相同。
格式:recv remote-file [local-file]
说明:remote-file 指定要复制的远程文件。
local-file 指定要在本地计算机上使用的名称。如果没有指定,文件将命名为 remote-file。
FTP >remotehelp 显示远程命令帮助。
格式:remotehelp [command]
说明:command 指定需要帮助的命令的名称。如果没有指定 command,ftp将显示全部远程命令的列表。
FTP >rename 重命名远程文件。
格式:rename filename newfilename
说明:filename 指定要重命名的文件。 newfilename 指定新的文件名。
FTP >rmdir 删除远程目录。
格式:rmdir directory
说明:directory 指定要删除的远程目录的名称。
FTP >send 使用当前文件传送类型将本地文件复制到远程计算机上。Send 与put 相同。
格式:send local-file [remote-file]
说明:local-file 指定要复制的本地文件。 remote-file 指定要在远程计算机上使用的名称。如果没有指定,文件将命名为 local-file。
FTP >status 显示 FTP 连接和切换的当前状态。
FTP >trace 切换数据包跟踪。Trace 在运行 ftp 命令时显示每个数据包的路由。
FTP >type 设置或显示文件传送类型。
格式:type [type-name]
说明:type-name 指定文件传送类型。默认设置为 ascii。如果没有指定type-name,将显示当前的类型。
FTP >user 指定远程计算机的用户。
格式:user username [password] [account]
说明:user-name 指定登录到远程计算机所使用的用户名。password 指定 user-name 的密码。如果没有指定,但必须指定,ftp 会提示输入密码。
account 指定登录到远程计算机所使用的帐户。如果没有指定account,但是需要指定,ftp 会提示您输入帐户。
FTP >verbose 切换 verbose 模式。如果打开,将显示所有 ftp 响应。在文件传送完成后,将同时显示与传送效率有关的统计信息。默认情况下,verbose 是打开的。
1)[crud[args)1:在本地机中执行交互shell,exit回到FTP环境, 列如:!LS.zip.
2)$macro-amc[args儿执行宏定义macro-name。
3)accountlpassword]:提供登录远程系统成功后访问系统资源所需的补充口令。
4)append local-file[remote-file]:将本地文件追加到远程系统主机,若未指定远系统文件名,则使用本地文件名。
5)aSCii:使用ascII型传输方式。
6)bell:每个命令执行完毕后计算机响铃—次
7)bin:使用二进制文件传输方式
8)bye..退出FTP会话过程—
9)case:在使用mget时,将远程主文件名中的大写字母转为小写字母
10)cdremote·dir:进入远程主机目录。
11)cdup..进入远程主机目录的父目录。
12)chmodmodefile-name:将远程主机文件file-name的存取方式设置为mode。列如:chmod777a.OUt。
13)close:中断与远程服务器的FTP会话(与open对应)。
14)cr:使用aSSC“方式传输文件时,将回车换行转换为回行
15)deleteremote-file-删除远程主机文件:
16)debugldebug-value3:.设置调试方式,显示发送至远程主机的每条命令。例如:debup3,若设为0,表示取消debug。
17)dir[remote-dir][Local-file]:显示远程主机目录,并将结果存入本地文件local-file:
18)disconnection-.同close。
19)formformat:将文件传输方式设置为format,缺省为file方式。
20)getremote-file[10cal-file]:将远程主机的文件remote-file传至本地 硬盘的local-file。
21)glob:设置mdelete,mget,mput的文件名扩展,缺省时不扩展文件名,同命令行的-g参数。
22)hash:每传输1024字节,显示一个hash符号(#)。
23)help[cmd]:显示FTP内部命令cmd的帮助信息,如.-helpget。
24)idle[seconds]:将远程服务器的休眠计时器设为[seconds]秒。
25)image:设置二进制传输方式(同binary)。
26)LCD[DIR]:将本地工作目录切换至dir。
27)LS[remote-DIR][LOCAL-FILE]:显示远程目录remote-dir,并存入本地文local-fileo
28)macdefmacro-name:定义一个宏,遇到macdef下的空行时,宏定义结束。
29)mdelete[remote-file]:删除远程主机文件。
30)mdirremote-fileslocal-file:与dlr类似,但可指定多个远程文件。 列如mdir.O..zipoutfiLe。
31)mgetremote-files:传输多个远程文件。
32)mkdirdirname:在远程主机中建一目录。
33)misremote-filelocal-file.同nlist,但可指定多个文件名。
34)mode[modename]:将文件传输方式设置为modename,缺省为stream方式。
35)modtimefile-name..显示远程主机文件的最后修改时间。 ·
36)mputlocal-file:将多个文件传输至远程主机,
37)newerfile-name: 如果远程机中file-name的修改时间比本地硬盘同名文件的时间巨近,则重新传输该文件。 ·
38)nlist正remote·di41local-file3:显示远程主机目录的文件清单,并存入本地硬盘的local-fileo
39)nmap[npattem outpattem]设置文件名映射机制,使得文件传输时,文件中的某些字符相互转换,如:nmapSl.S2.S3[,][,],则传输文件a1.a2.a3时,文件名变为a1,a20该命令特别适用于远程主机为非UNIX机的情况o
40)ntrans[Inchars[outchars]]设置文件名字符的翻译机制,如ntranslR,则文件名LLI将变为RRR。
41)openhost[port]:建立指定FTP服务器连接,可指定连接端口。
42)passive:进入被动传输方式。
43)prompt:设置多个文件传输时的交互提示。
44)proxy FTP-cmd:在次要控制连接中,执行一条FTP命令,该命令允许连接两个FTP服务器,以在两个服务器间传输文件。第一条FTP命令必须为open,以首先建立两个服务器间的连接。
45)putlocal-file[remote-file]:将本地文件local-file传送至远程主机。
46)vwd:显示远程主机的当前工作目录。
47)qmt-.同bye,退出FTP会话。
48)quote argl,arg2。。。:将参数逐字发至远程卸服务器,如:quote, syst。
49)recvremote-file[Local-file):同get。
50)reget remote-file[Local-file]:类似于get,但若local-file存在,则从上次传输中断处继续传输。
51)rhelp[cmd-name]:请求获得远程主机的帮助。
52)rstatus[FILe-name]:若未指定文件名,则显示远程主机的状态,否则显示文件状态,
53)rename[FRom)[to]:更改远程主机文件名。
54)reset:清除回答队列。
55)restart marker:从指定的标志marker处,重新开始get或put,如:restartl30。
56)rmdirdir-name:删除远程主机目录。
57)mnique:设置文件名惟一性存储,若文件存在,则在原文件后加后缀.1,.2等
58)send local-file[remote-file):同put
59)sendport:设置PORT命令的使用。
60)siteargl,arg2。。。:将参数作为SITE命令逐字发送至远程卸主机。
61)sizefile-name:显示远程主机文件大小,如:Slteidle7200。
62)stares:。显示当前FTP状态。 ·
63)struct[struct-name]:将文件传输结构设置为struct-name,缺省时使用stream结构。
64)suniclue:将远程主机文件名存储设置为惟一(与mnique对应)。
65)system:显示远程主机的 *** 作系统类型。
66)tenex:将文件:传输类型设置为TENEX机的所需的类型
67)tick:设置传输时的字节计数器
68)trace:设置包跟踪。
69)type[type-name):设置文件传输类型为type-name,缺省为ascii,
例如:typebinary,设置二进制传输方式。
70)umask[newmask):将远程服务器的缺省umask设置为newmask。 例如:umask 3。
71)user user-name [passwordⅡaccount]:向远程主机表明自己的身份,需要口令时,必须输入口令,如:useranonymousmy@emaiL。
72)verbose:同命令行的-v参数,即设置详尽报告方式,FTP服务器的所有响应都将显示给用户,缺省为on。
73)[cmd]:同help。
如果是通过命令行交互式的:
1
ftp
server_ip
2
提示输入用户名:输入你的ftp用户名
3
提示输入密码:输入ftp用户的密码
4
切换为bin模式:b或者bin命令
5
用get命令接完整文件名:get
your_file
6
用wget+通配符模式获取多个文件:wget
txt
7
退出ftp:bye
以上就是关于linux ftp下如何get多个目录的文件全部的内容,包括:linux ftp下如何get多个目录的文件、java获取ftp文件路径怎么写、请列出FTP的常见命令等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)