You are reading the article How Linux Wget Command Works updated in September 2023 on the website Happystarlongbien.com. We hope that the information we have shared is helpful to you. If you find the content interesting and meaningful, please share it with your friends and continue to follow and support us for the latest updates. Suggested October 2023 How Linux Wget Command Works
Given below are the examples:
wget command
It is the basic command of wget. It will download the single file from the provided URL. It will also provide the file download timestamp and status bar.
We need to download it as per the below command.
Note: By default, the wget package is not present in the Linux operating system.
Code:
Explanation:
As per the below output screenshot, we are in the data directory. There are no data/files present in it.
Using the wget command, we are able to download the wget file form the internet. It will store the download file in the current or working directory.
Output:
Example #2wget command – Download file with own filename
In Wget, we have the provision to give the own file name for any download file. We need to use the “-O” option with wget command.
Code:
Explanation:
As per the above command, we are using the “-O” option with wget command.
It is useful to change the download file name to our own file name. Here, we are using “test-file.tar.gz” as our own file name.
Output:
Example #3wget command – Download Multiple Files
In wget, we have the functionality to download multiple files in the same command. We need to provide the multiple download URL to the wget command.
Code:
Explanation:
As per the above command, we are able to download multiple files at the same time. We just need to pass the multiple URL in the command.
We have passed the sample pdf URL and tar file URL. At the end result, we will get both files in the same working directory.
Output:
Example #4wget command – Download from File URL
In wget, we are able to download the number of files from the internet with the help of the URL file. URL File is nothing but a simple file into which we have copied the entire download URL’s.
Code:
wget -i url.txtExplanation:
We have kept the entire download URL in “url.txt” file and passing the file to the wget command.
Output:
Example #5wget command – Resume Download
Code:
Explanation:
As per the above command, we are able to resume the older download file.
The download file was manually stopped. But with the help of the “-c” option, we can resume the download file.
Output:
Example #6wget command – RestrictBandwidth
The tool is used to get detailed information on the Wget interface.
Code:
Explanation:
We can restrict bandwidth utilization while downloading the file to avoid a network bandwidth issue.
As per the network speed, we can define the bandwidth utilization for download. Here we have to define 50KB as the download speed.
Output:
Example #7wget command – Download with a User ID and Password
As per the secure download, we can provide the login credentials details in wget command.
Code:
Explanation:
As per the security point of view, we can provide the login id and password while downloading any particular or secured file from the HTTP and FTP protocols.
Output:
Example #8wget command- Download in Background
With the help of the wget command, we are able to download the files in the background.
Code:
Explanation:
As per the below screenshot, we are downloading the file in the background.
Output:
Example #9wget command- Help and Version
We are able to get the wget version and command help. It will help to understand the working of the wget command.
Code:
wget –help wget --versionExplanation:
When we need to explore more about the wget command, we can use the “–help” option.
It will provide all the basic information like different option, command, etc.
The version information we will provide the wget version details. Which is used in the current Linux Server.
Output:
Help
Version
ConclusionWe have seen the uncut concept of “Linux wget command” with the proper example, explanation, and command with different outputs. The wget command is used to download the files form the internet or intranet. It is a secure way to download the files.
Recommended ArticlesWe hope that this EDUCBA information on “Linux wget” was beneficial to you. You can view EDUCBA’s recommended articles for more information.
You're reading How Linux Wget Command Works
Update the detailed information about How Linux Wget Command Works on the Happystarlongbien.com website. We hope the article's content will meet your needs, and we will regularly update the information to provide you with the fastest and most accurate information. Have a great day!