2017-02-24 3 views
1

私がウェブサイトを持っている:http://www.example.com/images/どのようにすべての孫ディレクトリからファイルをwgetのために

このサブディレクトリには、それらの内の画像と、多くのサブディレクトリが含まれています:http://www.example.com/

このウェブサイトは、サブディレクトリを持っている

私はimagesディレクトリからwgetをしようとすると、それは、各ディレクトリ(01/02/、など)と、各1のindex.html内部をダウンロードします。いずれの画像もダウンロードしません。例えば

wget -r http://www.example.com/images/ <は - PNG画像

wget -r http://www.example.com/images/01/ <をダウンロードしない - どのように私は、各サブディレクトリを経由せずimages/ディレクトリのすべてのサブディレクトリからすべてのpng Sをダウンロードするwgetを使用することができますPNG画像

をダウンロードしません(01 /、02 /、03 /、など)を一つずつ?

+1

うんとして一緒にコマンドを置くことができます。ありがとうございました! – Aaron

答えて

1

ご要望に応じてオプションを検索するには、man wgetをご覧ください。私はこれらを発見した迅速な検索が、

-A acclist --accept acclist   
     Specify comma-separated lists of file name suffixes or patterns to 
     accept or reject. 

--no-directories 
     Do not create a hierarchy of directories when retrieving recursively. 
     With this option turned on, all files will get saved to the current directory, 
     without clobbering (if a name shows up more than once, the filenames will get extensions .n). 

Recursive Retrieval Options 
-r 
--recursive 
     Turn on recursive retrieving. The default maximum depth is 5. 

が一緒にこれらを組み合わせることで、あなたは助け

wget -nd -r -A png http://www.example.com/images/ 
関連する問題