Categories
shellinfo tips

WGET with examples

The wget command is a free utility in the Linux command-line interface for non-interactive download of files from the web. It supports HTTP, HTTPS, and FTP protocols, and can retrieve files through HTTP proxies. In this blog post, we’ll delve into the wget command, providing a comprehensive understanding with practical examples.
Understanding the ‘wget’ Command

The wget command is primarily used to download files from the internet. The basic syntax of the wget command is as follows:

wget [option]... [URL]...

Downloading Files with ‘wget’

To download a file from a URL, you simply provide the URL as an argument:

wget https://example.com/file.txt

This command will download the file file.txt from https://example.com.
Downloading in the Background with ‘wget’

If you’re downloading a large file, you may want to run wget in the background. You can do this with the -b (background) option:

wget -b https://example.com/large-file.zip

This command will download large-file.zip in the background.
Limiting the Download Rate with ‘wget’

To prevent wget from using all available bandwidth, you can limit the download rate with the –limit-rate option:

wget --limit-rate=200k https://example.com/large-file.zip

This command will limit the download rate to 200 KB/s.
Downloading Multiple Files with ‘wget’

To download multiple files, you can provide multiple URLs:

wget https://example.com/file1.txt https://example.com/file2.txt

This command will download file1.txt and file2.txt.
Conclusion

The wget command is a powerful tool for downloading files in Linux. Whether you’re downloading a single file, running in the background, limiting the download rate, or downloading multiple files, wget provides a flexible way to download files directly from the command line. With the examples provided in this guide, you’re well on your way to mastering the wget command.

Leave a Reply

Your email address will not be published. Required fields are marked *