Linux FTP 命令实例

ftp 主机名/IP /*登录ftp服务器,会提示输入用户名和密码*/

ftp> help
列出所有的FTP命令

ftp> ls
列出远程服务器当前目录的所有文件和目录

ftp> cd blog
改变远程服务器目录为blog

ftp> cd ..
返回上一级目录

ftp> lcd images
改变本地服务器目录为images

ftp> ascii
设定以ascii方式传送文件(缺省值)

ftp> binary
设定以binary方式传送文件

ftp> get file1.php
下载远程服务器的file1.php文件到本地服务器。注意:如果本地服务器存在file1.php,将会被覆盖。

ftp> put file2.php
上传本地服务器的file2.php文件到远程服务器。注意:如果远程服务器存在file2.php,将会被覆盖。

ftp> !ls
在命令前加“!”,表示执行本地服务器的指定命令。所以,!ls表示列出本地服务器当前目录的文件和目录。

ftp> mget *.jpg
下载所有“.jpg”文件

ftp> mput *.jpg
上传所有“.jpg”文件

ftp> mdelete *.jpg
删除远程服务器的“.jpg”文件

ftp> prompt
开启或关闭“提醒模式”

ftp> quit
退出FTP程序

ftp> bye
同quit

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>