Difficulty: Beginner
Estimated Time: 10 minutes

In this lesson we will learn how to download sites in linux using wget command. In this example we will download locally the following site: http://copy.sh/v86/ Here's a screenshot of the site: copy.sh/v86/

Don’t stop now! The next scenario will only take about 10 minutes to complete.

Download site in linux

Step 1 of 3

Download site

Create directory to download the site and switch to it: mkdir copy.sh && cd copy.sh

Check you are in the right directory: pwd

Download the site copy.sh/v86 up to 2nd level: wget --recursive --level=3 http://copy.sh/v86/ wget --recursive --level=3 http://copy.sh/v86/images/

To see size of the downloaded site on disk: du -h | tail -2|head -1

Compress the site: tar -czvf copy.sh.tar.gz copy.sh

See the size of the compressed site: ls -lh *.gz| awk '{ print $5 " " $9}'

Now let's start web server for remote access to the compressed file: python2 -m SimpleHTTPServer 8080

You can now download the file using your web browser https://[[HOST_SUBDOMAIN]]-8080-[[KATACODA_HOST]].environments.katacoda.com/copy.sh.tar.gz

Or browse all the files on: https://[[HOST_SUBDOMAIN]]-8080-[[KATACODA_HOST]].environments.katacoda.com/