环境说明

[root@Check3 ~]# cat /etc/redhat-release
CentOS release 6.9 (Final)
[root@Check3 ~]# uname -a
Linux Check3 -.el6.x86_64 # SMP Wed Nov  :: UTC  x86_64 x86_64 x86_64 GNU/Linux

FTP客户端安装

[root@Check3 ~]# yum -y install ftp

连接远程ftp server

格式fit IP 端口

[root@Check3 ~]# ftp
Connected to 192.168.1.10 (192.168.1.10).
-#####################################################
-FileZilla Server version  beta
-Welcome To Elements FTP
 #####################################################
Name (192.168.1.10:root): Admin
 Password required for admin
Password:
 Logged on
Remote system type is UNIX.

命令参数

显示当前FTP连接状态

ftp> status
Connected to 192.168.1.10.
No proxy connection.
Mode: stream; Type: ascii; Form: non-print; Structure: file
Verbose: on; Bell: off; Prompting: on; Globbing: on
Store unique: off; Receive unique: off
Case: off; CR stripping: on
Ntrans: off
Nmap: off
Hash mark printing: off; Use of PORT cmds: on
Tick counter printing: off

显示远程主机系统类型

ftp> system
 UNIX emulated by FileZilla

列出当前目录下的文件或目录

dir 等同于 ls

ftp> dir
 Entering Passive Mode (,)
 Opening data channel for directory listing of "/"
drwxr-xr-x  ftp ftp  Oct   WCY
drwxr-xr-x  ftp ftp  Aug   ***
drwxr-xr-x  ftp ftp  Dec  : ***
drwxr-xr-x  ftp ftp  Dec  : ***
drwxr-xr-x  ftp ftp  Nov   ***
drwxr-xr-x  ftp ftp  Nov  : ***
drwxr-xr-x  ftp ftp  Dec  : ***
drwxr-xr-x  ftp ftp  Nov  : ***
 Successfully transferred "/"

ftp> ls
 Entering Passive Mode (,)
 Opening data channel for directory listing of "/"
drwxr-xr-x  ftp ftp  Oct   WCY
drwxr-xr-x  ftp ftp  Aug   ***
drwxr-xr-x  ftp ftp  Dec  : ***
drwxr-xr-x  ftp ftp  Dec  : ***
drwxr-xr-x  ftp ftp  Nov   ***
drwxr-xr-x  ftp ftp  Nov  : ***
drwxr-xr-x  ftp ftp  Dec  : ***
drwxr-xr-x  ftp ftp  Nov  : ***
 Successfully transferred "/"

列出当前所在远程FTP路径

ftp> cd WCY
 CWD successful. "/WCY" is current directory.
ftp> pwd
 "/WCY" is current directory.

在远程主机中创建目录

ftp> mkdir test
 "/WCY/test" created successfully
ftp> ls
 Entering Passive Mode (,)
 Opening data channel for directory listing of "/WCY"
drwxr-xr-x  ftp ftp  Dec  : test
 Successfully transferred "/WCY"

删除远程主机中的目录

ftp> rmdir test
 Directory deleted successfully
ftp> ls
 Entering Passive Mode (,)
 Opening data channel for directory listing of "/WCY"
 Successfully transferred "/WCY"

返回上一级

cdup  或 cd ..

改变远程主机文件权限

chmod  权限  文件

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

等价命令send

ftp> put /root/test.wcy /WCY/test.wcy
local: /root/test.wcy remote: /WCY/test.wcy
 Entering Passive Mode (,)
 Opening data channel for file upload to server of "/WCY/test.wcy"
 Successfully transferred "/WCY/test.wcy"
 bytes sent in 3.3e-05 secs (636.36 Kbytes/sec)
ftp> cd /WCY
 CWD successful. "/WCY" is current directory.
ftp> ls
 Entering Passive Mode (,)
 Opening data channel for directory listing of "/WCY"
-rw-r--r--  ftp ftp  Dec  : test.wcy
 Successfully transferred "/WCY"

将本地主机中一批文件传送至远程主机

mput local-files

删除远程主机中的文件

ftp> ls
 Entering Passive Mode (,)
 Opening data channel for directory listing of "/WCY"
-rw-r--r--  ftp ftp  Oct   MySQL--.el7.x86_64.rpm-bundle.tar
-rw-r--r--  ftp ftp  Dec  : test.wcy
 Successfully transferred "/WCY"
ftp> delet MySQL--.el7.x86_64.rpm-bundle.tar
 File deleted successfully
ftp> ls
 Entering Passive Mode (,)
 Opening data channel for directory listing of "/WCY"
-rw-r--r--  ftp ftp  Dec  : test.wcy
 Successfully transferred "/WCY"

删除远程上的一批文件

mdelete [remote-files]

将文件从远程主机上下载到本地主机中

等价命令recv

ftp> pwd
 "/通用文件/linux/mysql" is current directory.
ftp> .tar.gz /root/perl-.tar.gz
local: /root/perl-.tar.gz remote: /通用文件/linux/mysql/perl-.tar.gz
 Entering Passive Mode (,)
 Opening data channel for file download from server of "/通用文件/linux/mysql/perl-5.10.0.tar.gz"
WARNING!  bare linefeeds received in ASCII mode
File may not have transferred correctly.
 Successfully transferred "/通用文件/linux/mysql/perl-5.10.0.tar.gz"
 bytes received in 0.33 secs (47322.31 Kbytes/sec)

从远程主机上下载一批文件到本地主机

mget [remote-files]

退出

ftp> bye
 Goodbye

内容整理至网络,如遇不懂的请自行baidu

Centos下ftp协议连接远程ftp server主机的更多相关文章

  1. Notepad++ 连接远程 FTP 进行文件编辑

    一.下载安装 Notepad++ 1.下载 Notepad++ : https://pan.baidu.com/s/1o7VrS4y 密码 : ck8a 2.安装 Notepad++ 2.1.勾选所有 ...

  2. centos下修改docker连接docker_host默认方式为tls方式

    1.安装docker,请参考官网文档 centos下安装docker 2.安装完成应该可以使用docker的各种命令连接docker host.docker host运行在本机上,但与localhos ...

  3. ArcCatalog连接远程ArcGIS Server服务器

    注意:本地机器登陆的用户名和密码必须与ArcGIS Server服务器上的用户名和密码完全一致,并加入到agsadmin和agsuser组中.重启电脑.   (其实就是在自己的电脑上建立一个用户名,这 ...

  4. Ubuntu下使用vpn连接远程服务器

    公司的服务器提供了vpn接入点,这样在家里也可以通过vpn连到公司的服务器里作一些事情.昨天下午申请了vpn帐号,然后先在windows下试着连接vpn服务器,一切okay,证明自己的vpn帐户没有问 ...

  5. centOs下的php+mysql+apache+ftp配置

    在安装服务器时做了相应的笔记,这个方法是亲身经验成功的,随着版本的不断更新,也许会有一些地方不同,但是基本原理都是一样的. 1.安装CentOS 6 ,可以选择最小安装,也可以安装桌面 2.升级系统 ...

  6. CentOS下通过rdesktop连接Windows远程桌面

    众所周知,微软的Windows提供了一种远程桌面系统(Remote Desktop),该服务的默认端口是3389,可使用户远程登录进行系统管理或作为终端服务器运行各种应用软件. 而要连接Windows ...

  7. CentOS下配置redis允许远程连接

    1. 目的 因为想要学习redis,因此在虚拟机中安装了redis,为了实现在物理机可以访问redis,弄了好久:因此记录下来,以免忘记. 2. 环境 虚拟机:CentOS Linux release ...

  8. 在mac下使用终端命令通过ssh协议连接远程linux系统,代替windows的putty

    指令:ssh username@server.address.com 事例:wangmingdeMacBook-Pro:~ xxxxxxxxxx$ ssh root@XXXX.net The auth ...

  9. Node.js使用ftp连接远程ftp服务器枚举和下载文件示例

    示例代码: var Ftp = require('ftp'); var fs = require('fs'); var path = require('path'); // 首先判断参数中是否包含{d ...

随机推荐

  1. 160311、mybatis sql语句中转义字符

    问题: 在mapper  ***.xml中的sql语句中,不能直接用大于号.小于号要用转义字符 解决方法:   1.转义字符串 小于号    <    < 大于号    >    & ...

  2. Spring的泛型依赖注入

    Spring 4.x 中可以为子类注入子类对应的泛型类型的成员变量的引用,(这样子类和子类对应的泛型类自动建立关系)具体说明: 泛型注入:就是Bean1和Bean2注入了泛型,并且Bean1和Bean ...

  3. 关于Springboot 中注入多个cacheManage 时候 存在报错

    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'e ...

  4. FW:主流RPC框架

    主流RPC框架  2015年10月27日  zman  RPC 介绍目前在互联网公司比较流行的开源的RPC框架. RPC框架比较   语言 协议 ​服务治理 ​社区 机构 Hessian 多语言 he ...

  5. Spring Data之Hello World

    1. 概述 SpringData : 注意目标是使数据库的访问变得方便快捷;支持NoSQL和关系数据存储; 支持NoSQL存储: MongoDB(文档数据库) Neo4j(图形数据库) Redis(键 ...

  6. 病毒侵袭持续中---hdu3065(AC自动机模板)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3065 模板题,没什么好说的... #include<stdio.h> #include&l ...

  7. Java设计模式-工厂方法模式(Virtual Constructor/Polymorphic Factory)

    工厂方法模式(Virtual Constructor/Polymorphic Factory) 工厂方法模式是类的创建模式,又叫做虚拟构造子模式(Virtual Constructor)或者多态性工厂 ...

  8. python插入记录后获取最后一条数据的id

    python插入记录后取得主键id的方法(cursor.lastrowid和conn.insert_id()) 参考:https://blog.csdn.net/qq_37788558/article ...

  9. 华为交换机VRP用户界面配置及Telnet登录实验

    user privilege level level 设置使用以上用户界面登录后的用户级别 5 acl acl-number { inbound | outbound } (可选)在用户界面上应用AC ...

  10. repo使用

    repo常用指令: 1.repo init(下载repo并克隆manifest) repo init -u URL [OPTIONS] Options: -u:制定一个URL,其连接到一个manife ...