• 要找福利?记不住网址?搜不到?如何与我们保持联系?试试 CTRL+D 把零点博客添加进您的浏览器收藏夹,一键直达永不失联!

Linux ncftp命令

linux系统 涛涛 141次浏览 0个评论

Linux ncftp命令用于传输文件。

FTP让用户得以下载存放于服务器主机的文件,也能将文件上传到远端主机放置。

NcFTP是文字模式FTP程序的佼佼者,它具备多样特色, 包括显示传输速率,下载进度,自动续传,标住书签,可通过防火墙和代理服务器等。

当不指定用户名时,ncftp 命令会自动尝试使用匿名账户anonymous 去连接远程FTP 服 务器,不需要用户输入账号和密码。

语法

<span class="pln">ncftp </span><span class="pun">[主机或</span><span class="pln">IP</span><span class="pun">地址]</span>

参数说明:

  • -u<用户名> 指定登录FTP服务器的用户名
  • -p<密码> 设置用户密码
  • -P<端口号> 指定FTP端口号,默认为21
  • -j<账号> 指定账号
  • -h 帮助信息
  • -v 版本信息

实例

使用ncftp命令匿名连接FTP服务器。

例如想匿名连接ftp.kernel.org服务器,同时不想输入anonymous等匿名用户名,可直接使用ncftp命令:

<span class="pln">ncftp ftp</span><span class="pun">.</span><span class="pln">kernel</span><span class="pun">.</span><span class="pln">org</span>

得到如下信息:

<span class="pln">$ ncftp ftp</span><span class="pun">.</span><span class="pln">kernel</span><span class="pun">.</span><span class="pln">org </span><span class="com">#匿名连接ftp.kernel.org服务器  </span>
<span class="typ">NcFTP</span> <span class="lit">3.2</span><span class="pun">.</span><span class="lit">1</span> <span class="pun">(</span><span class="typ">Jul</span> <span class="lit">29</span><span class="pun">,</span> <span class="lit">2007</span><span class="pun">)</span> <span class="kwd">by</span> <span class="typ">Mike</span> <span class="typ">Gleason</span> <span class="pun">(</span><span class="pln">http</span><span class="pun">:</span><span class="com">//www.NcFTP.com/contact/).  </span>
<span class="com">#ncftp版权、版本等信息  </span>
<span class="typ">Copyright</span> <span class="pun">(</span><span class="pln">c</span><span class="pun">)</span> <span class="lit">1992</span><span class="pun">-</span><span class="lit">2005</span> <span class="kwd">by</span> <span class="typ">Mike</span> <span class="typ">Gleason</span><span class="pun">.</span>  
<span class="typ">All</span><span class="pln"> rights reserved</span><span class="pun">.</span>  
<span class="typ">Connecting</span><span class="pln"> to </span><span class="lit">149.20</span><span class="pun">.</span><span class="lit">20.133</span><span class="pun">...</span> <span class="com">#连接服务器  </span>
<span class="typ">Welcome</span><span class="pln"> to ftp</span><span class="pun">.</span><span class="pln">kernel</span><span class="pun">.</span><span class="pln">org</span><span class="pun">.</span>  
<span class="typ">Logging</span> <span class="kwd">in</span><span class="pun">...</span> <span class="com">#匿名登录  </span>
<span class="typ">Welcome</span><span class="pln"> to the </span><span class="com">#欢迎信息  </span><span class="pln">
LINUX KERNEL ARCHIVES  
ftp</span><span class="pun">.</span><span class="pln">kernel</span><span class="pun">.</span><span class="pln">org  
</span><span class="str">"Much more than just kernels"</span><span class="pln">  
IF YOU</span><span class="str">'RE ACCESSING THIS SITE VIA A WEB BROWSER  
PLEASE USE THE HTTP URL BELOW INSTEAD!  
----> If you are looking for mirror sites, please go <---- 
----> to mirrors.kernel.org instead <---- 
This site is provided as a public service by the Linux Kernel  
Organization, a California nonprofit corporation. Bandwidth is  
provided by The Internet Software Consortium, Inc. Our servers are  
located in San Francisco and Palo Alto, California; Corvallis, Oregon;  
Amsterdam, Netherlands and Ume., Sweden; use in violation of any  
applicable laws strictly prohibited.  
Due to U.S. Exports Regulations, all cryptographic software on this  
site is subject to the following legal notice:  
This site includes publicly available encryption source code  
which, together with object code resulting from the compiling of  
publicly available source code, may be exported from the United  
States under License Exception "TSU" pursuant to 15 C.F.R. Section  
740.13(e).  
This legal notice applies to cryptographic software only. Please see  
the Bureau of Industry and Security (http://www.bis.doc.gov/) for more  
information about current U.S. regulations.  
Neither the Linux Kernel Organization, nor its sponsors make any  
guarantees, explicit or implicit, about the contents of this site.  
Use at your own risk.  
This site is accessible via the following mechanisms:  
FTP ftp://ftp.kernel.org/pub/  
HTTP http://www.kernel.org/pub/  
RSYNC rsync://rsync.kernel.org/pub/  
NFS and SMB/CIFS are no longer available.  
For comments on this site, please contact <ftpadmin@kernel.org>.  
Please do not use this address for questions that are not related to  
the operation of this site. Please see our homepage at  
http://www.kernel.org/ for links to Linux documentation resources.  
Login successful.  
Logged in to ftp.kernel.org.  
ncftp / > </span>

提示:ncftp的命令提示符为”ncftp / >”,而不是ftp中的”ftp / >”。

使用ncftp命令操作、下载文件。

ncftp的命令基本上与ftp相同,例如可以使用”cd”命令切换在FTP服务器中的当前目录,使用”ls”命令列出当前目录内容,使用”get”命令下载”/pub”目录下的README文件、使用”quit”离开ncftp等。操作结果如下:

<span class="pln">ncftp </span><span class="pun">/</span> <span class="pun">></span><span class="pln"> pwd               </span><span class="com">#查看当前路径  </span><span class="pln">
ftp</span><span class="pun">:</span><span class="com">//ftp.kernel.org        #当前路径为根目录  </span><span class="pln">
ncftp </span><span class="pun">/</span> <span class="pun">></span><span class="pln"> ls                </span><span class="com">#查看当前目录列表  </span><span class="pln">
bin</span><span class="pun">/</span><span class="pln"> for_mirrors_only</span><span class="pun">/</span><span class="pln"> pub</span><span class="pun">/</span><span class="pln">  
dev</span><span class="pun">/</span><span class="pln"> lib</span><span class="pun">/</span><span class="pln"> usr@  
etc</span><span class="pun">/</span><span class="pln"> lost</span><span class="pun">+</span><span class="pln">found</span><span class="pun">/</span><span class="pln"> welcome</span><span class="pun">.</span><span class="pln">msg@  
ncftp </span><span class="pun">/</span> <span class="pun">></span><span class="pln"> cd pub            </span><span class="com">#切换目录到pub 子目录  </span>
<span class="typ">Directory</span><span class="pln"> successfully changed</span><span class="pun">.</span><span class="pln">  
ncftp </span><span class="pun">/</span><span class="pln">pub </span><span class="pun">></span><span class="pln"> ls             </span><span class="com">#查看pub 的目录列表  </span><span class="pln">
dist</span><span class="pun">/</span><span class="pln"> media</span><span class="pun">/</span><span class="pln"> scm</span><span class="pun">/</span><span class="pln">  
index</span><span class="pun">.</span><span class="pln">html RCS</span><span class="pun">/</span><span class="pln"> site</span><span class="pun">/</span><span class="pln">  
linux</span><span class="pun">/</span><span class="pln"> README software</span><span class="pun">/</span><span class="pln">  
lost</span><span class="pun">+</span><span class="pln">found</span><span class="pun">/</span><span class="pln"> README_ABOUT_BZ2_FILES tools</span><span class="pun">/</span><span class="pln">  
ncftp </span><span class="pun">/</span><span class="pln">pub </span><span class="pun">></span> <span class="kwd">get</span><span class="pln"> README     </span><span class="com">#下载README 文件  </span><span class="pln">
README</span><span class="pun">:</span> <span class="lit">1.87</span><span class="pln"> KB </span><span class="lit">10.39</span><span class="pln"> KB</span><span class="pun">/</span><span class="pln">s  
ncftp </span><span class="pun">/</span><span class="pln">pub </span><span class="pun">></span><span class="pln"> quit           </span><span class="com">#离开ncftp </span>

与ftp不同的是,ncftp此时会提示用户是否将FTP服务器保存为书签,以便于下次登录,用户可以进行自定义书签名等操作,如下所示:

<span class="typ">You</span><span class="pln"> have </span><span class="kwd">not</span><span class="pln"> saved a bookmark </span><span class="kwd">for</span> <span class="kwd">this</span><span class="pln"> site</span><span class="pun">.</span>  <span class="com">#离开提示信息  </span>
<span class="typ">Would</span><span class="pln"> you like to save a bookmark to</span><span class="pun">:</span><span class="pln">  
ftp</span><span class="pun">:</span><span class="com">//ftp.kernel.org/pub/  </span>
<span class="typ">Save</span><span class="pun">?</span> <span class="pun">(</span><span class="pln">yes</span><span class="pun">/</span><span class="kwd">no</span><span class="pun">)</span><span class="pln"> yes                            </span><span class="com">#确认是否保存  </span>
<span class="typ">Enter</span><span class="pln"> a name </span><span class="kwd">for</span> <span class="kwd">this</span><span class="pln"> bookmark</span><span class="pun">,</span> <span class="kwd">or</span><span class="pln"> hit enter </span><span class="kwd">for</span> <span class="str">"kernel"</span><span class="pun">:</span><span class="pln"> kernel </span><span class="com">#输入书签名  </span>
<span class="typ">Bookmark</span> <span class="str">"kernel"</span><span class="pln"> saved</span><span class="pun">.</span>

欢迎转载本文:Linux ncftp命令
喜欢 (0)
[ld]
分享 (0)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址