Linux:
wget --version
sudo apt-get install wget
Windows:
https://eternallybored.org/misc/wget/
- Now you can either put it somewhere and make a path to the file or Move to Windows Directory and open cmd and type wget --help and you can see what you can do or --verson.
-
macOS:
- Wget is not included by default on macOS, but you can install it using package managers like
Homebrew or MacPorts.
- If you have Homebrew installed, open a terminal and run the following command to install Wget:
brew install wget
- If you prefer MacPorts, use the following command in the terminal:
sudo port install wget
- Both Homebrew and MacPorts handle the installation process, including any dependencies.
After following these steps, you should have Wget installed on your respective operating system. You can verify
the installation by running wget --version
in the terminal or command prompt, which should display
the version information if Wget is properly installed.
Using Wget to Download
how do you use wget
Wget is a command-line tool used for downloading files from the web. It is available on most Unix-like systems,
including Linux, macOS, and BSD. Wget allows you to retrieve files using various protocols such as HTTP, HTTPS,
FTP, and more. Here's a basic usage guide for Wget:
-
Open a terminal or command prompt: Depending on your operating system, open the terminal or command
prompt. On Linux and macOS, you can usually find it in the applications or utilities folder. On Windows,
you can open the command prompt by pressing Win + R, typing "cmd," and hitting Enter.
-
Navigate to the directory where you want to save the downloaded file: Use the cd
command to
change directories. For example, if you want to save the file on your desktop on Linux or macOS, you can
use the following command:
~/Desktop
On Windows, if you want to save the file on your desktop, use this command:
cd C:\Users\YourUsername\Desktop
- Use the Wget command to download a file: The basic syntax of the Wget command is:
wget [options][URL]
Replace [URL]
with the actual URL of the file you want to download. Here are some commonly used
options:
-O [filename]
: Specify a different name for the downloaded file. For example:
wget -O myfile.txt http://example.com/file.txt
-P [directory]
: Specify a different directory to save the downloaded file. For example:
wget -P /path/to/save http://example.com/file.txt
-
-c
: Resume a partially downloaded file. If the file already exists, Wget will attempt to
continue the download from where it left off.
-
-r
: Download recursively, i.e., download all files linked from the given URL.
-
--user=[username]
and --password=[password]
: Specify a username and password
for websites that require authentication.
-
--limit-rate=[amount]
: Limit the download rate to a specified amount. For example,
--limit-rate=1m
limits the download rate to 1 megabyte per second.
-
--no-check-certificate
: Skip certificate verification for HTTPS connections.
-
If you want to download a whole site use
--mirror
-
If you want to download a whole site and have wget convert the links
wget --mirror --page-requisites --convert-link --no-clobber --no-parent --domains domain.com http://domain.com
These are just a few examples of the options available in Wget. You can find more options and details in the Wget
documentation or by running wget --help
.
- Execute the command: Once you've constructed the Wget command with the desired options and URL, execute it
by pressing Enter. Wget will start downloading the file, and you'll see the progress displayed in the
terminal.
That's the basic usage of Wget. It's a versatile tool with many additional features and options. Be sure to refer
to the documentation for more advanced usage or specific requirements. how to download wget for Linux windows and macOS