Skip to content

Instantly share code, notes, and snippets.

@ko31
Last active December 17, 2019 06:51
Show Gist options
  • Save ko31/da079745c9c855ced04471197850d739 to your computer and use it in GitHub Desktop.
Save ko31/da079745c9c855ced04471197850d739 to your computer and use it in GitHub Desktop.
Download website files using wget

Usage

wget -P /path/to/download -E -k -m -nH -np -p -c https://example.com
Option Overview
-P Set save directory path.
-E This option will cause the suitable suffix to be appended to the local filename.
-k After the download is complete, convert the links in the document to make them suitable for local viewing.
-m Turn on options suitable for mirroring.
-nH Disable generation of host-prefixed directories.
-np Do not ever ascend to the parent directory when retrieving recursively.
-p This option causes Wget to download all the files that are necessary to properly display a given HTML page.
-c Continue getting a partially-downloaded file.

With basic authentication

wget -P /path/to/download -E -k -m -nH -np -p -c --http-user=username --http-password=password https://example.com
Option Overview
--http-user Set username.
--http-password Set password.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment