ftp : 2つのホスト間でファイル転送を行う
構文
ftp [-ginv] [host]
説明
ftpサーバーに接続し、ファイル転送をおこなう
オプション
| -g | 正規化表現を無効にする |
|---|---|
| -i | 複数のファイル転送中にプロンプトを表示させない |
| -n | 「.netrc」を使用した自動ログインを行わない |
| -t | パケットのトレース機能を有効にする |
| -v | リモートサーバーからのすべてのレスポンス情報を表示する |
内部コマンド
| ascii, asc | 転送モードをテキスト(ASCIIモード)にする |
|---|---|
| binary, bin | 転送モードをバイナリにする |
| bye, quit | ftpを終了する |
| close, disconnect | リモートホストから切断する |
| dir | リモートホストのディレクトリのファイル一覧を表示する |
| get file | リモートホストのファイルをローカルホストで受信する |
| lcd dir | ローカルホストのディレクトリを移動する |
| ls [dir] [file] | リモートホストのディレクトリのファイル一覧を表示する |
| mget files | リモートホストの複数のファイルをローカルホストで受信する |
| mkdir | ディレクトリを作成する |
| mput files | ローカルホストの複数のファイルをリモートホストへ送信する |
| open host | リモートホストに接続する |
| put file | ローカルホストのファイルをリモートホストへ送信する |
使用例
ftp> open 192.168.11.200 Connected to 192.168.11.200 (192.168.11.200). 220 Welcome to blah FTP service. Name (192.168.11.200:hoge): foo 331 Please specify the password. Password: 230 Login successful. Remote system type is UNIX. Using binary mode to transfer files. ftp> ls 227 Entering Passive Mode (192,168,11,200,48,27) 150 Here comes the directory listing. drwxr-xr-x 2 500 500 4096 Aug 13 2010 Desktop -rw-rw-r-- 1 500 500 104857600 Feb 04 2011 testfile 226 Directory send OK. ftp> get testfile local: testfile remote: testfile 227 Entering Passive Mode (192,168,11,200,33,0) 150 Opening BINARY mode data connection for testfile (104857600 bytes). 226 File send OK. 104857600 bytes received in 40.6 secs (2.5e+03 Kbytes/sec) ftp> bye 221 Goodbye.
