35

「curl -sO」コマンドを使用して、この GitHub プロジェクト リンクからプロジェクト ファイルをダウンロードしました: http://github.com/ziyaddin/xampp/archive/master.zip

が、ダウンロードできませんでした。エラーが発生し、次のように表示されます。

Archive:  /home/ziyaddin/Desktop/master.zip
[/home/ziyaddin/Desktop/master.zip]   End-of-central-directory
signature not found.  Either this file is not   a zipfile, or it
constitutes one disk of a multi-part archive.  In the   latter case
the central directory and zipfile comment will be found on   the last
disk(s) of this archive. zipinfo:  cannot find zipfile directory in
one of /home/ziyaddin/Desktop/master.zip or
          /home/ziyaddin/Desktop/master.zip.zip, and cannot find 
/home/ziyaddin/Desktop/master.zip.ZIP, period.

しかし、curl コマンドでこのリンクをダウンロードできます: http://cloud.github.com/downloads/pivotal/jasmine/jasmine-standalone-1.3.1.zip

cloud.github.com にあるからだと思います。curl コマンドを使用して最初のリンクからダウンロードする方法を知りたいですか?

4

5 に答える 5

75
curl -L -O https://github.com/ziyaddin/xampp/archive/master.zip
  • 使用する必要がありますhttps://
  • -Lリダイレクトに従うために使用する必要があります
于 2013-04-28T08:59:04.153 に答える
7

tarball( *.tar.gz ) をダウンロードすることもできます:

curl -LkSs https://api.github.com/repos/ziyaddin/xampp/tarball -o master.tar.gz

または-O、ファイル名を省略できますが、保存された「.tar.gz」ファイルはデフォルトで「tarball」という名前になるため、名前を変更して「.tar.gz」ファイルタイプの接尾辞を追加する必要があります。したがって、上記のように (小文字)-oを使用します。残り:

  • Ss- サイレント モードを使用しますが、エラーがあれば表示します
  • k- TLS 証明書をチェックせずに安全でないSSL 接続を使用します。
于 2014-01-28T18:30:20.740 に答える
4
$ curl -I http://github.com/ziyaddin/xampp/archive/master.zip
HTTP/1.1 301 永久に移動
サーバー: GitHub.com
日付: 2013 年 4 月 28 日 (日) 09:24:53 GMT
コンテンツタイプ: text/html
コンテンツの長さ: 178
接続: 閉じる
場所: https://github.com/ziyaddin/xampp/archive/master.zip
Vary: Accept-Encoding

... したがって-L、HTTP リダイレクトをたどりたい場合は使用する必要があります。または、スティーブン・ペニーの答えを読んでください...

于 2013-04-28T09:26:04.820 に答える
4

curl -JLO "https://github.com/tada/pljava/archive/V1_6_2.zip"

-J, --remote-header-name ヘッダー提供のファイル名 (H) を使用します。
-L, --location リダイレクトに従います (H)。
-O, --remote-name リモートファイルとして指定されたファイルに出力を書き込みます。

要点リファレンス

于 2021-02-20T01:07:12.837 に答える