Linux系统通过命令使用FTP的详细方法
时间:2023-12-05 04:29:28
众所周知,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:ose1.bmp,则
ftp》 get /rose/1.bmp 1.bmp (回车)
b) mget
格式:mget [remote-files]
从远端主机接收一批文件至本地主机。
如要获取服务器上E:ose下的所有文件,则
ftp》 cd /rose
ftp》 mget *.* (回车)
注意:文件都下载到了linux主机的当前目录下。比如,在 /root/yint下运行的ftp命令,则文件都下载到了/root/yint下。
3.上传文件
a) put
格式:put local-file [remote-file]
将本地一个文件传送至远端主机中。
如要把本地的1.bmp传送到远端主机E:ose,并改名为333.bmp
ftp》 put 1.bmp /rose/333.bmp (回车)
b) mput
格式:mput local-files
将本地主机中一批文件传送至远端主机。
如要把本地当前目录下所有bmp文件上传到服务器E:ose 下
ftp》 cd /rose (回车)
ftp》 mput *.bmp (回车)
注意:上传文件都来自于主机的当前目录下。比如,在 /root/yint下运行的ftp命令,则只有在/root/yint下的文件linux才会上传到服务器E:ose 下。
4. 断开连接
bye:中断与服务器的连接。
ftp》 bye (回车)
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
iOS 13 小技巧:在“信息”中使用表情贴纸
![](https://img.aspxhome.com/file/2023/2/a195932_0s.png)
win10系统搜索功能无法使用怎么办?
![](https://img.aspxhome.com/file/2023/1/a278124_0s.png)
word如何开头空两格?
![](https://img.aspxhome.com/file/2023/5/34385_0s.gif)
qplus.exe是什么进程
两种方法帮你快速找回鼠标右键菜单中的bitlocker选项!
![](https://img.aspxhome.com/file/2023/30/a267761_0s.jpg)
Win7系统硬件加速怎么开启?
![](https://img.aspxhome.com/file/2023/5/a314309_0s.jpg)
win11关机后主机还在运行怎么解决?
![](https://img.aspxhome.com/file/2023/30/a270475_0s.jpg)
怎样解决Win XP操作系统DHCP故障:获取未使用的IP地址
Word 2007中的段落对齐方式和对齐方式?
Word怎么对数据进行快速计算?
![](https://img.aspxhome.com/file/2023/7/25897_0s.jpg)
Win10电脑怎么修改鼠标指针?
![](https://img.aspxhome.com/file/2023/26/a223175_0s.jpg)
Win11提示无法安装程序包怎么办?
![](https://img.aspxhome.com/file/2023/27/a238458_0s.png)
Windows7系统下快捷方式无法添加到任务栏问题解决方法
在Word中用框架划分子窗口的秘技
![](https://img.aspxhome.com/file/2023/1/24781_0s.png)
迅捷CAD编辑器怎么设置图纸显示模式?迅捷CAD编辑器设置图纸显示模式的方法
![](https://img.aspxhome.com/file/2023/8/a334300_0s.jpg)
国外大神制作的史上最精简Win10 系统,真有那么好用吗?
![](https://img.aspxhome.com/file/2023/27/a239008_0s.jpg)
电脑安装软件提示Comdlg32.ocx错误的解决方法
![](https://img.aspxhome.com/file/2023/6/a326479_0s.jpg)
在Excel工作表中插入分类汇总的方法
浏览器遇到有些网页打不开的解决方法
win7 64位纯净版图标变成了一样该怎么办?win7旗舰版图标变成一样的解决方法
![](https://img.aspxhome.com/file/2023/28/a247184_0s.jpg)