ftp -d

estis2013/06/22 (土) 21:48 に投稿

ftpコマンドのdオプションを使うと、FTPの生のコマンドが確認できる。

$ ftp -d example.net
Connected to example.net.
220 203.0.113.1 FTP server ready
ftp_login: user `<null>' pass `<null>' host `example.net'
Name (exsample.net:localuser): user
---> USER user
331 Password required for user
Password: 
---> PASS XXXX
230 User user logged in
---> SYST
215 UNIX Type: L8
Remote system type is UNIX.
Using binary mode to transfer files.
---> FEAT
211-Features:
 MDTM
 MFMT
 TVFS
 AUTH TLS
 MFF modify;UNIX.group;UNIX.mode;
 MLST modify*;perm*;size*;type*;unique*;UNIX.group*;UNIX.mode*;UNIX.owner*;
 PBSZ
 PROT
 REST STREAM
 SIZE
211 End
features[FEAT_FEAT] = 1
features[FEAT_MDTM] = 1
features[FEAT_MLST] = 1
features[FEAT_REST_STREAM] = 1
features[FEAT_SIZE] = 1
features[FEAT_TVFS] = 1
got localcwd as `/Users/localuser'
---> PWD
257 "/" is the current directory
got remotecwd as `/'
ftp> ls
---> EPSV
229 Entering Extended Passive Mode (|||47339|)
229 Entering Extended Passive Mode (|||47339|)
---> LIST
150 Opening ASCII mode data connection for file list
drwxr-xr-x  10 user      group       4096 May  3 19:42 .
(略)
226 Transfer complete
ftp> cd etc
---> CWD etc
250 CWD command successful
---> PWD
257 "/etc" is the current directory
got remotecwd as `/etc'
ftp> by
---> QUIT
221 Goodbye.