How to use FTP
Forward from: https://www.server-world.info/en/note?os=CentOS_7&p=ftp&f=2
Thanks for your share!
| [1] | Install FTP Client. |
| [root@dlp ~]#
yum -y install lftp
|
| [2] | The connection with root account is prohibited by default, so access with an common user to FTP Server. |
|
# lftp [option] [hostname]
[redhat@dlp ~]$ lftp -u cent www.srv.world
Password: # password of the user
lftp cent@www.srv.world:~> # show current directory on FTP server
lftp cent@www.srv.world:~> pwd
ftp://cent@www.srv.world # show current directory on local server
lftp cent@www.srv.world:~> !pwd
/home/redhat # show files in current directory on FTP server
lftp cent@www.srv.world:~> ls
drwxr-xr-x 2 1000 1000 23 Jul 19 01:33 public_html # show files in current directory on local server
lftp cent@www.srv.world:~> !ls -l
total 12 # change directory
lftp cent@www.srv.world:~> cd public_html
lftp cent@www.srv.world:~/public_html> pwd
ftp://cent@www.srv.world/%2Fhome/cent/public_html # upload a file to FTP server
# "-a" means ascii mode ( default is binary mode )
lftp cent@www.srv.world:~> put -a redhat.txt
22 bytes transferred ls
drwxr-xr-x 2 1000 1000 23 Jul 19 01:33 public_html # upload some files to FTP server
lftp cent@www.srv.world:~> mput -a test.txt test2.txt
22 bytes transferred ls
drwxr-xr-x 2 1000 1000 23 Jul 19 01:33 public_html # download a file from FTP server
# "-a" means ascii mode ( default is binary mode )
lftp cent@www.srv.world:~> get -a test.py
416 bytes transferred # download some files from FTP server
lftp cent@www.srv.world:~> mget -a test.txt test2.txt
20 bytes transferred # create a directory in current directory on FTP Server
lftp cent@www.srv.world:~> mkdir testdir
mkdir ok, `testdir' created ls
drwxr-xr-x 2 1000 1000 23 Jul 19 01:33 public_html # delete a direcroty in current directory on FTP Server
lftp cent@www.srv.world:~> rmdir testdir
rmdir ok, `testdir' removed ls
drwxr-xr-x 2 1000 1000 23 Jul 19 01:33 public_html # delete a file in current directory on FTP Server
lftp cent@www.srv.world:~> rm test2.txt
rm ok, `test2.txt' removed ls
drwxr-xr-x 2 1000 1000 23 Jul 19 01:33 public_html # delete some files in current directory on FTP Server
lftp cent@www.srv.world:~> mrm redhat.txt test.txt
rm ok, 2 files removed ls
drwxr-xr-x 2 1000 1000 23 Jul 19 01:33 public_html # execute commands with "![command]"
lftp cent@www.srv.world:~> !cat /etc/passwd
root:x:0:0:root:/root:/bin/bash # exit
lftp cent@www.srv.world:~> quit
221 Goodbye. |
How to use FTP的更多相关文章
- 8.仿阿里云虚拟云服务器的FTP(包括FTP文件夹大小限制)
平台之大势何人能挡? 带着你的Net飞奔吧!:http://www.cnblogs.com/dunitian/p/4822808.html#iis 原文:http://dnt.dkill.net/Ar ...
- Hyper-V无法文件拖拽解决方案~~~这次用一个取巧的方法架设一个FTP来访问某个磁盘,并方便的读写文件
异常处理汇总-服 务 器 http://www.cnblogs.com/dunitian/p/4522983.html 服务器相关的知识点:http://www.cnblogs.com/dunitia ...
- 阿里云学生优惠Windows Server 2012 R2安装IIS,ftp等组件,绑定服务器域名,域名解析到服务器,域名备案,以及安装期间错误的解决方案
前言: 这几天终于还是按耐不住买了一个月阿里云的学生优惠.只要是学生,在学信网上注册过,并且支付宝实名认证,就可以用9块9的价格买阿里云的云服务ECS.确实是相当的优惠. 我买的是Windows S ...
- win7下利用ftp实现华为路由器的上传和下载
win7下利用ftp实现华为路由器的上传和下载 1. Win7下ftp的安装和配置 (1)开始->控制面板->程序->程序和功能->打开或关闭Windows功能 (2)在Wi ...
- Java实现FTP文件与文件夹的上传和下载
Java实现FTP文件与文件夹的上传和下载 FTP 是File Transfer Protocol(文件传输协议)的英文简称,而中文简称为"文传协议".用于Internet上的控制 ...
- centos下开启ftp服务
如果要ftp访问linux需要安装ftp服务,vsftpd是Linux下比较好的的FTP服务器. 一.检查安装vsftp //检查是否安装vsftpd rpm -qa | grep vsftpd // ...
- 解决开启服务器防火墙导致ftp不能连接的问题
在防火墙设置的"高级"选项卡中的"网络连接设置"--"本地连接"--"设置"中添加了"FTP服务器" ...
- centos6.5 nginx-1.8.0和ftp搭建图片服务器
一.Nginx的安装步骤 1.Nginx安装环境: gcc: 安装nginx需要先将官网下载的源码进行编译,编译依赖gcc环境,如果没有gcc环境,需要安装gcc:yum install gcc-c+ ...
- Jenkins配置MSBuild实现自动部署(MSBuild+SVN/Subversion+FTP+BAT)
所要用到的主要插件: [MSBuild Plugin] 具体操作: 1.配置MSBuild的版本 [系统管理]->[Global Tool Configuration]->[MSBuild ...
- [CentOs7]搭建ftp服务器(2)——添加用户
摘要 上篇文章完成了ftp服务器的安装与匿名访问的内容,当然出于安全的考虑是不允许匿名访问服务器的,所以就有了本篇的内容 ,为ftp服务器添加用户,用改用户进行访问. vsftpd添加用户 FTP用户 ...
随机推荐
- MongoDB学习笔记~自己封装的Curd操作(查询集合对象属性,更新集合对象)
回到目录 我不得不说,mongodb官方驱动在与.net结合上做的不是很好,不是很理想,所以,我决定对它进行了二次封装,这是显得很必然了,每个人都希望使用简单的对象,而对使用复杂,麻烦,容易出错的对象 ...
- springMVC基础controller类
此文章是基于 搭建SpringMVC+Spring+Hibernate平台 功能:设置请求.响应对象:session.cookie操作:ajax访问返回json数据: 创建springMVC基础con ...
- Sqlserver游标复习
经常写存储过程,但今天在游标使用过程中还是疏忽了一些事情,执行过程中一直执行不下去,后来直接sqlserver挂了,教训啊! 代码虽简单,望铭记: Create PROCEDURE [dbo].[te ...
- 关于Hadoop的集群环境下虚拟机采用NAT方式连不上网的解决
使用虚拟机搭建hadoop集群的时候采用的是NAT方式联网,但是会出现时常掉网的现象,查看后排查了很久也没有发现什么问题. 很可能是Windows下的NAT服务没有开启,这时候尽管虚拟机和主机是在一个 ...
- save(),saveOrUpdate(),merge()的区别
Save save()方法能够保存实体到数据库,正如方法名称save这个单词所表明的意思.我们能够在事务之外调用这个方法,这也是我不喜欢使用这个方法保存数据的原因.假如两个实体之间有关系(例如empl ...
- 解决www.github.com访问太慢的问题
解决www.github.com访问太慢的问题 使用www.github.com的过程中,有时候打开会特别的慢,原因github.com的域名被一堵伟大的墙挡在了外面.但是我们可以通过修改本机的hos ...
- jdbc java数据库连接 3)Statement接口之执行DDL、DML、DQL
|- Statement接口: 用于执行静态的sql语句 |- int executeUpdate(String sql) : 执行静态的更新sql语句(DDL,DML) |- ResultSet ...
- 激活windows7 企业版小记
问题:状态不可用 1)控制面板->管理工具->服务,启动SPP Notification Service和Software Protection两项服务后 重启计算机,仍然提示状态不可用. ...
- jquery的各种隐藏显现动画的区别
<!DOCTYPE html> <html> <head lang="en"> <meta charset="utf-8&quo ...
- WPF Popup 控件导致被遮挡内容不刷新的原因
WPF Popup 控件导致被遮挡内容不刷新的原因 周银辉 今天在写一个WPF控件时用到了Popup控件,很郁闷的情况是:当popup关闭时,原来被popup挡住的界面部分不刷新,非要手动刷新一下(比 ...