How do I use the wget command?
This article provides a quick and practical overview of the
wget command-line utility, explaining what it is and how it
functions. Below, you will learn about its core capabilities, the basic
syntax required to execute downloads, a few essential flags for everyday
terminal tasks, and where to find a dedicated resource to deepen your
knowledge of this indispensable networking tool.
Understanding the Basics
The wget tool is a free, non-interactive network utility
primarily used to download files from the internet. The name itself is a
portmanteau of “World Wide Web” and “get.” Because it is strictly
non-interactive, it can smoothly run in the background or while the user
is logged off, making it perfect for automating downloads through shell
scripts or cron jobs without requiring active user supervision. It
robustly supports standard internet protocols, including HTTP, HTTPS,
and FTP, and can seamlessly navigate through HTTP proxies.
Essential Features and Commands
Using the tool is highly straightforward. The fundamental syntax involves simply calling the command followed by the exact URL of the file you wish to download. However, its true power lies in its extensive list of options and flags:
- Standard Download: Executing
wget [URL]will fetch the target file and save it directly into your current working directory. - Resuming Interrupted Downloads: If your internet
connection drops or a large download is interrupted, the
-c(continue) flag allows you to resume a partially downloaded file right from where it left off, saving valuable time and bandwidth. - Background Execution: By utilizing the
-bflag, you can force the download to process entirely in the background, instantly freeing up your terminal window for other commands. - Mirroring a Website: The
-mflag transforms the utility into a web crawler, allowing you to create a complete local mirror of a website for offline viewing by recursively downloading HTML files and their associated assets. - Rate Limiting: If you are on a shared network, you
can use the
--limit-rateflag to restrict the download speed, ensuring the tool does not consume all available bandwidth.
Further Learning and Resources
Whether you are a system administrator automating remote server backups or a developer downloading large datasets, mastering this utility will significantly streamline your workflow. To explore more advanced configurations, complex command combinations, and practical examples, you can reference https://salivity.github.io/wget, an excellent resource for this tool.