1

I red this answer and is working perfectly nice. But I need some more information regarding this.

The command provided in the solution above is not able to download some PDF files which are not displayed on web page.

Let U1 be the base url and U1/pdf1 and U1/pdf2 be the link for two pdf files.

But suppose if the second link is hidden (not accessible from the web page) and can be accessible only if the link is known.

The command in solution can able to get pdf1 and cannot able to get pdf2. How can I download pdf2 also using ubuntu?

hanugm
  • 333
  • 2
    If the URL is not known the site would need to have directory browsing allowed, or you'd have to simply brute force it until you get the correct URL. – M. Becerra Jan 25 '18 at 09:39
  • If you know all the links, put them into a file and run xargs wget < file. – Melebius Jan 25 '18 at 09:52

1 Answers1

0

PDFs can be downloaded easily by wget command as mentioned below

#wget -c pdf_url_link_here 

and if you want to download all available PDF files from multiple websites in once. kindly make a text file(website_list) with websites name as I have made a file and play below-mentioned one-liner script

#wget -c $(for website in $(cat websites_list); do     lynx -cache=0 -dump -listonly "$website" | awk '/.pdf$/{print $2}';done) 
Mr. Linux
  • 189