/usr/bin/ftp
ftp ホスト名 | IPアドレス | ファイル転送を行います。 |
---|
-i | 複数ファイルの転送中に、対話形式のプロンプトを出力しないようにします。 |
---|---|
-p | データ転送を受動モードで行います。このオプションは、ファイアウォールを介して接続されているリモートホストと通信する場合に便利です。 |
ftp 192.168.128.111
IPアドレス192.168.128.111のサーバにftp接続します。
# ftp 192.168.128.111 Connected to 192.168.128.111 220 host123 FTP server ready. Name (192.168.128.111:root): user1 331 Password required for root. Password: 230 User user1 logged in. Remote system type is UNIX. Using binary mode to transfer files. ftp> put file1 200 PORT command successful. 150 Opening BINARY mode data connection for file1 (560717824 bytes). 226 Transfer complete. local: file1 remote: file1 560717824 bytes received in 48 seconds (11331.22 Kbytes/s) ftp> bye 221-You have transferred 560717824 bytes in 1 files. 221-Total traffic for this session was 560722143 bytes in 3 transfers. 221-Thank you for using the FTP service on pw200. 221 Goodbye.
サーバ接続後ftpプロンプトが表示されます。
ftpプロンプト内でユーザーコマンドを使用してファイル操作を行います。
プロンプトを抜けるにはbyeコマンドを使用します。
pwd | 接続先のカレントディレクトリを表示します。 |
---|---|
cd | 接続先のカレントディレクトリを移動します。 |
ls | 接続先のファイルエントリの情報を表示します。 |
get | ファイルをダウンロードします。 |
put | ファイルをアップロードします。 |
mget | ファイルを複数ダウンロードします。 |
mput | ファイルを複数アップロードします。 |
lcd | ローカルホストのカレントディレクトリを移動します。 |
bye | リモートホストとの接続を切断します。 |
!command | command で指定したコマンドを、ローカルマシン上でシェルコマン ドとして実行します。 |
binary | バイナリ転送モードに切り替えます。 |