How to download a website in linux

To download a website in linux is quite easy process. The inbuilt wget tool can get the job done in a hassle free manner. Moreover, this tool comes with a number of optional parameters to configure the download process.

How to download a website in linux

To download a website using wget, open terminal and type

wget \
 --recursive \    
 --no-clobber \
 --page-requisites \
 --html-extension \
 --convert-links \
 --restrict-file-names=windows \
 --domains website.org \
 --no-parent \
 http://artofcoding.in

The options are explained below

  • –recursive:  download all the links of the website.
  • –domains website.org:  ignore the links outside of website.org
  • –no-parent:  ignore the links outside the directory artofcoding.in/.
  • –page-requisites:  download all the elements needed by the page being downloaded e.g. css, images etc.
  • –html-extension:  save the downloaded pages with extension .html.
  • –convert-links:  This option will try to the change the links so that they might work offline as well.
  • –restrict-file-names=windows:  This option will try to modify the names of downloaded files so that they can work on windows operating system as well.
  • –no-clobber:  this option will prevent the overwriting of existing files and  might be handy when an interrupted download is resumed.