5

My question is in a title: Is there a way to download all .txt files from the page via curl or wget command? Thanks

1 Answer 1

5

You can use wget with -A to specify a type of file and -rto be recursive:

wget -r -A '*.txt' http://url-to-webpage-with-txts/
9
  • I've tried this corrected one, but just got index.html Feb 13, 2015 at 13:00
  • I've tested on Linux Debian using bash. Is it possible that the txt files are behind an user/password authentication on the website?
    – jcbermu
    Feb 13, 2015 at 13:05
  • No, it is possible to wget each file separately,here is link: introcs.cs.princeton.edu/java/21function Feb 13, 2015 at 14:09
  • I tried and only downloaded robots.txt. Are you sure that there are .txt files on that server?
    – jcbermu
    Feb 13, 2015 at 14:29
  • Oh, my bad, this link : cs.princeton.edu/introcs/21function Feb 13, 2015 at 14:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .