LoginSignup
0
0

【2023年8月版】curl で ftpクライアント

Posted at

はじめに

ftp で接続できるか動作確認しないと。。。

ftpクライアントはいってないやん。。。

そうだ、curlでやろう

の、いつもコマンド忘れるので、メモ

curl で ftp

ユーザ名 ftp
パスワード ftppass
サーバ 192.168.100.1
取得するファイル /share/abcd.txt

ファイルの取得

$ curl -O -u ftp:ftppass ftp://192.168.100.1/share/abcd.txt

ファイルの中身を表示

$ curl -u ftp:ftppass ftp://192.168.100.1/share/abcd.txt

ファイルの中身を表示+ftpプロトコルでの詳細表示

$ curl -v -u ftp:ftppass ftp://192.168.100.1/share/abcd.txt

IPv6等で拡張PASVモードを利用させない

$ curl --disable-epsv -v -u ftp:ftppass ftp://192.168.100.1/share/abcd.txt

アクティブモードでの接続

curlではPASVがデフォルト

$ curl --ftp-port - -v -u ftp:ftppass ftp://192.168.100.1/share/abcd.txt

さいごに

かんたんでしたね

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0