标 题: ftp 使用简介 作 者: kaoc.bbs@gopher.ncku.edu.tw ( +O-> ) ftp 简易用法 ============ 使用简例 : Sparc2>ftp mail <— ftp 至中心之 mail_host Connected to mail.ncku.edu.tw. 220 mail FTP server (SunOS 4.1) ready. Name (mail:yang): anonymous <— 键入 user_name 331 Guest login ok, send ident as password. Password: <— 键入 password 230 Guest login ok, access restrictions apply. ftp> dir <— 显示远方主机之较详细之目录内容 200 PORT command successful. 200 PORT command successful. 150 ASCII data connection for /bin/ls (140.116.3.52,1509) (0 bytes). total 35 -rw-r--r-- 1 ftp daemon 245 May 24 1992 .desc -rw-r--r-- 1 root daemon 18 May 24 1992 .desc.note -rw-r--r-- 1 ftp daemon 1024 Dec 15 05:00 .desc.pag dr-xr-xr-x 2 ftp wheel 512 Sep 15 1992 bin -r-xr-x--- 1 ftp daemon 24576 May 24 1992 describe dr-xr-xr-x 2 ftp wheel 512 Nov 16 1992 etc dr-xr-xr-x 12 ftp wheel 512 May 19 07:58 pub -rw-r--r-- 1 ftp daemon 761 Apr 8 17:48 readme -rw-r--r-- 1 ftp daemon 1242 Oct 23 1992 upload.rule 226 ASCII Transfer complete. 755 bytes received in 0.16 seconds (4.7 Kbytes/s) ftp> cd pub/UNIX/utility <— 变换远方主机的目录 250 CWD command successful. ftp> dir 200 PORT command successful. 150 ASCII data connection for /bin/ls (140.116.3.52,1510) (0 bytes). total 50 dr-xr-xr-x 2 ftp wheel 512 Nov 10 1992 unzip dr-xr-xr-x 2 ftp wheel 512 Nov 10 1992 unzip -r-xr-xr-x 1 ftp daemon 48374 Dec 16 08:20 uuencode.zip dr-xr-xr-x 2 ftp daemon 512 Dec 31 01:59 viewer 226 ASCII Transfer complete. 201 bytes received in 0.055 seconds (3.6 Kbytes/s) ftp> bin <— 将以下档案传输型式设为 binary 200 Type set to I. ftp> get uuencode.zip <— 撷取档案 200 PORT command successful. 150 Binary data connection for uuencode.zip (140.116.3.52,1511) (48374 bytes). 226 Binary Transfer complete. local: uuencode.zip remote: uuencode.zip 48374 bytes received in 0.14 seconds (3.4e+02 Kbytes/s) ftp> !ls -al uuencode.zip <— 执行本地主机的命令 ls -al -rw------- 1 yang 48374 May 21 10:08 uuencode.zip ftp> quit <— 结束 ftp 221 Goodbye. Sparc2> ftp 之命令 ========== ! cr ls prompt runique $ delete macdef proxy send account debug mdelete sendport status append dir mdir put struct ascii disconnect mget pwd sunique bell form mkdir quit tenex binary get mls quote trace bye glob mode recv type case hash mput remotehelp user cd help nmap rename verbose cdup image ntrans reset ? close lcd open rmdir 以下为较常用之命令 : open [host_name] : 建立一个与远端主机之连结 close : 结束与远端主机之连结, 但不离开 ftp, 可再用 open 与其他主机连结 close : 结束与远端主机之连结, 但不离开 ftp, 可再用 open 与其他主机连结 bye 或 quit : 结束与远端主机之连结, 且离开 ftp CTRL-C : 中断 ftp get rfile [lfile] : 撷取远端主机的档案 put lfile [rfile] 或 send lfile [rfile] : 传送档案至远端主机 mget rfile [lfile] : 一次颉取多个远端主机的档案, 可用通配字元 mput lfile [rfile] : 一次传送多个档案至远端主机, 可用通配字元 pwd : 显示远端主机现在那个目录 lcd ldir : 变换本地主机之工作目录 cd rdir : 变换远端主机之工作目录 ls [rdir] : 显示远端主机之工作目录内容 dir [rdir] : 显示远端主机之工作目录较详细内容 dir [rdir] : 显示远端主机之工作目录较详细内容 ascii : 设定档案传输型式为 ascii binary : 设定档案传输型式为 binary prompt : 设定在用 mget mput 传档时, 是否要询问使用者的回应 ! lcommand : 执行本地主机的命令 (以上 lfile->local file , ldir->local directory , lcommand->local command rfile->remote file ,rdir->remote directory) -- ☆ [Origin: ◎椰林风情◎] [From: woju.g1.ntu.edu.tw ] [Login: **] [Post: **]