Wget is a powerful command-line utility for downloading files from the web. Whether you need to grab a single file, mirror an entire website, or perform more advanced tasks, wget has got you covered.

Basic Usage:

CommandDescription
wget [URL]Download a file.
wget -O [new_filename] [URL]Rename the downloaded file.

Resuming Downloads:

CommandDescription
wget -c [URL]Resume an interrupted download.

Limiting Download Speed:

CommandDescription
wget --limit-rate=100k [URL]Limit download speed (e.g., 100KB/s).

Recursive Download:

CommandDescription
wget --recursive --no-clobber --page-requisites --html-extension --convert-links --domains website.com --no-parent [URL]Download entire website.

HTTP Authentication:

CommandDescription
wget --user=[username] --password=[password] [URL]HTTP Basic authentication.

FTP Download:

CommandDescription
wget ftp://username:password@ftp.example.com/file.txtDownload from FTP server.

Mirror a Website:

CommandDescription
wget --mirror --convert-links --adjust-extension --page-requisites --no-parent [URL]Mirror a website for offline viewing.

Quiet Mode:

CommandDescription
wget -q [URL]Run in quiet mode (no output except for errors).

Show Progress:

CommandDescription
wget --progress=bar [URL]Show a progress bar during download.

Logging:

CommandDescription
wget -o [logfile.txt] [URL]Log download output to a file.

Help and Version:

CommandDescription
wget --versionDisplay wget version.
wget --helpDisplay wget help.

Conclusion

This wget cheat sheet provides a handy reference for a variety of tasks, from basic file downloads to more advanced operations like mirroring websites. Experiment with these commands to streamline your file retrieval processes. Adjust the options based on your specific needs to make the most of wget‘s capabilities.