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>