Linux ncftp命令

Linux 命令大全 Linux 命令大全

Linux ncftp命令用于傳輸文件。

FTP讓用戶得以下載存放于服務(wù)器主機(jī)的文件,也能將文件上傳到遠(yuǎn)端主機(jī)放置。

NcFTP是文字模式FTP程序的佼佼者,它具備多樣特色, 包括顯示傳輸速率,下載進(jìn)度,自動續(xù)傳,標(biāo)住書簽,可通過防火墻和代理服務(wù)器等。

當(dāng)不指定用戶名時(shí),ncftp 命令會自動嘗試使用匿名賬戶anonymous 去連接遠(yuǎn)程FTP 服 務(wù)器,不需要用戶輸入賬號和密碼。

語法

ncftp [主機(jī)或IP地址]

參數(shù)說明:

  • -u<用戶名> 指定登錄FTP服務(wù)器的用戶名
  • -p<密碼> 設(shè)置用戶密碼
  • -P<端口號> 指定FTP端口號,默認(rèn)為21
  • -j<賬號> 指定賬號
  • -h 幫助信息
  • -v 版本信息

實(shí)例

使用ncftp命令匿名連接FTP服務(wù)器。

例如想匿名連接ftp.kernel.org服務(wù)器,同時(shí)不想輸入anonymous等匿名用戶名,可直接使用ncftp命令:

ncftp ftp.kernel.org

得到如下信息:

$ ncftp ftp.kernel.org #匿名連接ftp.kernel.org服務(wù)器  
NcFTP 3.2.1 (Jul 29, 2007) by Mike Gleason (http://www.NcFTP.com/contact/).  
#ncftp版權(quán)、版本等信息  
Copyright (c) 1992-2005 by Mike Gleason.  
All rights reserved.  
Connecting to 149.20.20.133... #連接服務(wù)器  
Welcome to ftp.kernel.org.  
Logging in... #匿名登錄  
Welcome to the #歡迎信息  
LINUX KERNEL ARCHIVES  
ftp.kernel.org  
"Much more than just kernels"  
IF YOU'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 / > 

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

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

ncftp的命令基本上與ftp相同,例如可以使用"cd"命令切換在FTP服務(wù)器中的當(dāng)前目錄,使用"ls"命令列出當(dāng)前目錄內(nèi)容,使用"get"命令下載"/pub"目錄下的README文件、使用"quit"離開ncftp等。操作結(jié)果如下:

ncftp / > pwd               #查看當(dāng)前路徑  
ftp://ftp.kernel.org        #當(dāng)前路徑為根目錄  
ncftp / > ls                #查看當(dāng)前目錄列表  
bin/ for_mirrors_only/ pub/  
dev/ lib/ usr@  
etc/ lost+found/ welcome.msg@  
ncftp / > cd pub            #切換目錄到pub 子目錄  
Directory successfully changed.  
ncftp /pub > ls             #查看pub 的目錄列表  
dist/ media/ scm/  
index.html RCS/ site/  
linux/ README software/  
lost+found/ README_ABOUT_BZ2_FILES tools/  
ncftp /pub > get README     #下載README 文件  
README: 1.87 KB 10.39 KB/s  
ncftp /pub > quit           #離開ncftp 

與ftp不同的是,ncftp此時(shí)會提示用戶是否將FTP服務(wù)器保存為書簽,以便于下次登錄,用戶可以進(jìn)行自定義書簽名等操作,如下所示:

You have not saved a bookmark for this site.  #離開提示信息  
Would you like to save a bookmark to:  
ftp://ftp.kernel.org/pub/  
Save? (yes/no) yes                            #確認(rèn)是否保存  
Enter a name for this bookmark, or hit enter for "kernel": kernel #輸入書簽名  
Bookmark "kernel" saved. 

Linux 命令大全 Linux 命令大全