wgetを使用してさまざまなリンクから複数のファイルをダウンロードする方法

wgetを使用してさまざまなリンクから複数のファイルをダウンロードする方法

ダウンロードしたいさまざまな画像があり、利用可能なリンクがあるとしましょう。

https://images.unsplash.com/photo-1548363585-5b1241ee3b85?ixlib=rb-1.2.1&auto=format&fit=crop&w=634&q=80

https://images.unsplash.com/photo-1556648011-e01aca870a81?ixlib=rb-1.2.1&auto=format&fit=crop&w=634&q=80

一つずつ入力したくない

wget https://images.unsplash.com/photo-1548363585-5b1241ee3b85?ixlib=rb-1.2.1&auto=format&fit=crop&w=634&q=80

wget https://images.unsplash.com/photo-1556648011-e01aca870a81?ixlib=rb-1.2.1&auto=format&fit=crop&w=634&q=80

この目標をどのように達成できますか?これらのリンクを.txtファイルに保存し、forループを使用することは正しいアプローチではないことを読んだ。

ベストアンサー1

ファイルに次のURLがある場合:

https://images.unsplash.com/photo-1548363585-5b1241ee3b85?ixlib=rb-1.2.1&auto=format&fit=crop&w=634&q=80
https://images.unsplash.com/photo-1556648011-e01aca870a81?ixlib=rb-1.2.1&auto=format&fit=crop&w=634&q=80

だからあなたは実行することができます

wget --input-file=file

@の説明に従って画像をダウンロードしてください。先行は達成するのが難しい

おすすめ記事