bash [script] - download website using wget


/ Published in: Bash
Save to your folder(s)

<ol><li>save as filename.sh</li><li>chmod u+x filename.sh</li><li>usage : ./filename.sh\"url\"</li></ol>


Copy this code and paste it in your HTML
  1. #! /bin/bash
  2. # use this script for downloading websites using 'wget' utility
  3. # replace URL field with the URL to be downloaded
  4.  
  5. URL="$1"
  6.  
  7. wget -Nrkpl 0 $URL
  8.  
  9. # wget flags and their functions
  10. # -r = recursive: follows the links
  11. # -k = changes links adresses to their local file adress
  12. # -p = downloads images
  13. # -l = recursion level. 0 for infinite.
  14.  
  15. exit

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.