歡迎您光臨本站 註冊首頁

Linux中的Ftp客戶端──為新手指南

←手機掃碼閱讀     火星人 @ 2014-03-24 , reply:0

一、簡介:
  
  在大多發行版都有打包,請到各大發行版的ftp列表中得到,或者在發行版的安裝盤中也能得到。lftp是一個命令行式的ftp客戶端。對中文支持較好。如果您在linux 的text模式下,要安裝zhcon或者cce之類的。
  
  安裝:
  
  1、RPM包管理的系統,請到
  
  http://freshrpms.net
  http;//rpmfind.net 上查找lftp的最新包,可以用
  
  #rpm -ivh name.rpm
  #rpm -Uvh name.rpm 這是升級之用
  
  2、源碼包安裝舉例:lftp-3.2.0.tar.bz2
  
  #tar zxvf lftp-3.2.0.tar.bz2
  #cd lftp-3.2.0
  #./configure
  #make
  #make install
  
  3.調用方法:
  
  lftp ftp://用戶名:密碼@地址
  
  比如:
  [beinan@S01~]$lftp ftp://beinan@192.168.1.2
  口令:
  lftp beinan@192.168.1.2:~>
  lftp beinan@192.168.1.2:~>ls
  
  -rw-r--r-- 1 1000 100 44387 May 18 10:04 xvmain.jpg
  -rw-r--r-- 1 1000 100 202643 May 18 09:45 xxx.jpeg
  -rw-r--r-- 1 1000 100 0 May 20 10:01 鯊魚的故事.txt
  
  二、使用方法:
  
  0.簡單的用法:lcd 切換本地目錄,比如 lcd /opt
  get 取回一個文件,put 向ftp伺服器傳文件;
  
  1、獲得幫助:
  
  代碼:
  
  lftp beinan@192.168.1.2:~> help
  !          (commands)
  alias [ []]      anon
  bookmark [SUBCMD]          cache [SUBCMD]
  cat [-b]           cd
  chmod [OPTS] mode file...      close [-a]
  [re]cls [opts] [path/][pattern]   debug [|off] [-o ]
  du [options]          exit [|bg]
  get [OPTS] [-o ]   glob [OPTS]
  help []            history -w file|-r file|-c|-l [cnt]
  jobs [-v]              kill all|
  lcd              lftp [OPTS]
  ls []             mget [OPTS]
  mirror [OPTS] [remote [local]]   mkdir [-p]
  module name [args]         more
  mput [OPTS]          mrm
  mv          [re]nlist []
  open [OPTS]          pget [OPTS] [-o ]
  put [OPTS] [-o ]   pwd [-p]
  queue [OPTS] []        quote
  repeat [delay] [command]      rm [-r] [-f]
  rmdir [-f]           scache []
  set [OPT] [ []]      site
  source             user []
  version               wait []
  zcat             zmore
  如果針對lftp的每個命令的幫助,應該是:
  
  lftp beinan@192.168.1.2:~> help 命令
  
  比如
  
  代碼:
  lftp beinan@192.168.1.2:~> help get
  
  用法: get [OPTS] [-o ]
  
  Retrieve remote file and store it to local file .
  -o specifies local file name (default - basename of rfile)
  -c continue, reget
  -E delete remote files after successful transfer
  -a use ascii mode (binary is the default)
  -O specifies base directory or URL where files should be placed
  
  簡介:gftp基於gtk的ftp客戶端,大家用的也比較多吧,支持中文目錄。如果您的gftp不能支持中文,請升級版本。
  
  # Written in C and has a text interface and a GTK+ 1.2/2.x interface
  # Supports the FTP, FTPS (control connection only), HTTP, HTTPS, SSH and FSP protocols
  # FTP and HTTP proxy server support
  # Supports FXP file transfers (transferring files between 2 remote servers via FTP)
  # Supports UNIX, EPLF, Novell, MacOS, VMS, MVS and NT (DOS) style directory listings
  # Bookmarks menu to allow you to quickly connect to remote sites
  
  下載安裝:
  
  在各大發行版中,都有gftp的打包,可以用各發行版自帶的工具來安裝。我只說源碼包安裝:
  
  源碼包安裝,通用於所有發行版,舉例說明:gftp-2.0.18.tar.bz2
  
  代碼:
  [root@S01ftp]#ls -lh
  
  總用量 1.4M
  
  -rw-r--r-- 1 root root 1.4M 2005-05-21 09:18 gftp-2.0.18.tar.bz2
  [root@S01ftp]#tar jxvf gftp-2.0.18.tar.bz2
  [root@S01gftp-2.0.18]#./configure
  [root@S01gftp-2.0.18]#make
  [root@S01gftp-2.0.18]#make install
  
  註:因為gftp依賴gtk,如果不能make過去,您應該指定PKG_CONFIG_PATH
  
  [root@S01gftp-2.0.18]# export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
  
  調用:
  
  代碼:
  
  [root@S01gftp-2.0.18]#gftp
  
 
  點擊看大圖

  
  主頁: http://www.iglooftp.com/linux/
  
  pro是商業版,不帶pro的已經很長時間沒有更新了。
  http://www.iglooftp.com/linux/index.html
  
  安裝比較簡單,因為是商業的,Install就行。
  
  對中文的支持還可以,不過是GTK1的,在新版本的發行版上執行的效果不理想。
  
  功能很全,對FXP支持較好。
  
  圖片可以到官方網站看。
  
  安裝舉例:
  
  代碼:
  [root@S01ftp]#tar zxvf IglooFTP-PRO-1.2.4-linux.tar.gz
  [root@S01ftp]#cd IglooFTP-PRO-1.2.4-linux
  [root@S01IglooFTP-PRO-1.2.4-linux]#sh Install
  調用方法:
  
  [root@S01IglooFTP-PRO-1.2.4-linux]#IglooFTP-PRO
  
  主頁:http://www.ncftp.com
  
  簡介:在 ZHCON 和 X 環境下面都沒有問題,對中文支持很好。是一個極不錯的text模式的ftp客戶端;
  
  NcFTP包括 伺服器版本和客戶端版本,我們在本帖中只介紹客戶端。
  
  安裝:編譯安裝
  
  您可以根據自己機器的架構,大多我們用的是intel cpu的機器 ,所以要選 x86版本,當然也能通過源碼包編譯安裝。
  
  本介紹中,我們還是用源碼包安裝,因為通用。
  
  下載:
  ftp://ftp.ncftp.com/ncftp/ncftp-3.1.9-src.tar.gz
  
  編譯安裝:
  
  #tar zxvf ncftp-3.1.9-src.tar.gz
  #cd ncftp-3.1.9
  #./configure
  #make
  #make install
  
  如果有依賴關係,或者需要指定PKG_CONFIG_PATH的變數,應該嘗試一下
  #export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
  
  然後再用上面的命令。
  
  調用:
  #ncftp ftp地址
  
  比如 :
  
  #ncftp 192.168.1.2
  
  對中文支持較好。
  
  看例子:
  ncftp /pub/電影 > put 鯊魚的故事.txt
  
  鯊魚的故事.txt: 0.00 B 0.00 B/s
  
  ncftp /pub/電影 > ls
  
  鯊魚的故事.txt
  
  ncftp /pub/電影 >
  
  至於ftp的使用,無非是put文件,get取迴文件,mput mget
  
  比如取回單個文件,可以用 get filename 放文件得可用 put filename,如果是取回整個目錄,則用get -R 目錄名,同理放一個目錄到FTP伺服器上,可以用 put -R 目錄
  
  比如我們想把FTP伺服器上的電影 目錄取回到 本地機的/opt目錄
  
  ncftp /pub > lcd /opt/
  ncftp /pub > ls
  sun/ sunmoon/ 電影/
  ncftp /pub > get -R 電影/
  
  如果想要得到幫助:
  
  ncftp /pub > help
  Commands may be abbreviated. 'help showall' shows hidden and unsupported
  commands. 'help ' gives a brief description of .
  
  ascii cat help lpage open quit show
  bgget cd jobs lpwd page quote site
  bgput chmod lcd lrename passive rename type
  bgstart close lchmod lrm pdir rhelp umask
  binary debug lls lrmdir pls rm version
  bookmark dir lmkdir ls put rmdir
  bookmarks get lookup mkdir pwd set
  
  For details, please see the manual ("man ncftp" at your regular shell prompt
  or online at http://www.NcFTP.com/ncftp/doc/ncftp.html).

[火星人 ] Linux中的Ftp客戶端──為新手指南已經有563次圍觀

http://coctec.com/docs/linux/show-post-137586.html