Curlでリクエスト中の進行状況を表示しない

curlでWEBページを保存する時に、オプションを指定しない場合は、下記のようにダウンロードできる進捗状況が表示されます。

通常にWEBページをダウンロードする場合はいいですが、シェルスクリプトでプログラムを実行している場合は、不要な場合が多いのでダウンロードの途中経過を表示する進捗状況を非表示するには「-s」のオプションを使用します。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$ curl -o google.html www.google.com
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 12885 0 12885 0 0 167k 0 --:--:-- --:--:-- --:--:-- 167k
$ curl -o google.html www.google.com % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 12885 0 12885 0 0 167k 0 --:--:-- --:--:-- --:--:-- 167k
$ curl -o google.html www.google.com
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 12885    0 12885    0     0   167k      0 --:--:-- --:--:-- --:--:--  167k

-s」のオプションでは、リクエスト中の進捗状況を表示しない場合のオプションですので、「-s」を使用すると下記のようにリクエスト中の進捗状況されません

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$ curl -s -o google.html www.google.com
$ curl -s -o google.html www.google.com
$ curl -s -o google.html www.google.com

 

スポンサーリンク

0
0