{"id":18882,"date":"2022-10-04T16:02:59","date_gmt":"2022-10-04T16:02:59","guid":{"rendered":"https:\/\/linuxways.net\/?p=18882"},"modified":"2022-11-04T02:45:30","modified_gmt":"2022-11-04T02:45:30","slug":"wget-download-files","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/linux-commands\/wget-download-files\/","title":{"rendered":"How to Wget to Download Files"},"content":{"rendered":"<p>The Wget command is a very helpful command in the Linux environment that allows us to download our desired files from the Internet. In most of the Linux distributions, this command comes pre-installed. In this article, we will be discussing the methods of using the Wget command for downloading files in Linux Mint 21.<\/p>\n<h2><strong>Using Wget to Download Files in Linux Mint 21:<\/strong><\/h2>\n<p>The following two methods will show you how you can download a single as well as multiple files by using Wget in Linux Mint 21.<\/p>\n<h2><strong>Method # 1: Downloading a Single File with Wget in Linux Mint 21<\/strong><\/h2>\n<p>If you only wish to download a single file with Wget in Linux Mint 21, then you have to proceed with the steps shown below:<\/p>\n<h3><strong>Step # 1: Download a Single File with Wget<\/strong><\/h3>\n<p>First, you need to run the following command:<\/p>\n<pre>\r\n$ wget https:\/\/file-examples.com\/wp-content\/uploads\/2017\/02\/file-sample_100kB.doc\r\n<\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"644\" height=\"38\" class=\"wp-image-18888\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18882-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18882-1.png 644w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18882-1-300x18.png 300w\" sizes=\"auto, (max-width: 644px) 100vw, 644px\" \/><\/strong><\/p>\n<p>Here, you only need to know the correct link to the file to be downloaded.<\/p>\n<p>When you run this command, the specified file will start downloading in your current working directory, and after some time, you will notice the termination of this command, as shown in the following image:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"647\" height=\"284\" class=\"wp-image-18889\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18882-2.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18882-2.png 647w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18882-2-300x132.png 300w\" sizes=\"auto, (max-width: 647px) 100vw, 647px\" \/><\/p>\n<h3><strong>Step # 2: Verify the Download<\/strong><\/h3>\n<p>Now, we will verify if the specified file has been downloaded successfully or not. For that, we will execute the command stated below:<\/p>\n<pre>\r\n$ ls \u2013l\r\n<\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"276\" height=\"23\" class=\"wp-image-18891\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18882-3.png\" \/><\/strong><\/p>\n<p>The downloaded file has been highlighted in the following image:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"590\" height=\"315\" class=\"wp-image-18895\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18882-4.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18882-4.png 590w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18882-4-300x160.png 300w\" sizes=\"auto, (max-width: 590px) 100vw, 590px\" \/><\/p>\n<h2><strong>Method # 2: Downloading Multiple Files at Once with Wget in Linux Mint 21<\/strong><\/h2>\n<p>At times, you might want to download multiple files at once while using the Wget command in Linux Mint 21. For that, you will have to perform an additional step as explained in the procedure below:<\/p>\n<h3><strong>Step # 1: Save the Links of All the Files to be downloaded to another File:<\/strong><\/h3>\n<p>First, you need to create a file to hold the links to all the files to be downloaded. For that, you can run the following command:<\/p>\n<pre>\r\n$ sudo nano myfiles\r\n<\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"370\" height=\"24\" class=\"wp-image-18899\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18882-5.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18882-5.png 370w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18882-5-300x19.png 300w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/><\/strong><\/p>\n<p>This command will create a file named \u201cmyfiles\u201d in the current working directory and will also open this file with the Nano editor.<\/p>\n<p>Once this file opens with the Nano editor, you need to copy and paste the links of all the files to be downloaded into this file. We have pasted the links to three different files into this file as shown in the image below. After that, you can simply press Ctrl+X to save this file and exit the editor.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"658\" height=\"465\" class=\"wp-image-18905\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18882-6.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18882-6.png 658w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18882-6-300x212.png 300w\" sizes=\"auto, (max-width: 658px) 100vw, 658px\" \/><\/p>\n<h3><strong>Step # 2: Download all the Files with Wget<\/strong><\/h3>\n<p>Now, to download all of these files at once with Wget, we will run the following command:<\/p>\n<pre>\r\n$ wget \u2013i myfiles\r\n<\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"352\" height=\"23\" class=\"wp-image-18906\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18882-7.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18882-7.png 352w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18882-7-300x20.png 300w\" sizes=\"auto, (max-width: 352px) 100vw, 352px\" \/><\/strong><\/p>\n<p>This command will instantly start downloading all the files by visiting the links mentioned in the \u201cmyfiles\u201d file. Once all the files have been downloaded, the output shown below will be rendered on the terminal:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"649\" height=\"413\" class=\"wp-image-18908\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18882-8.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18882-8.png 649w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18882-8-300x191.png 300w\" sizes=\"auto, (max-width: 649px) 100vw, 649px\" \/><\/p>\n<h3><strong>Step # 3: Verify the Download<\/strong><\/h3>\n<p>To check whether all the files have been successfully downloaded or not, we will run the following command:<\/p>\n<pre>\r\n$ ls \u2013l\r\n<\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"281\" height=\"23\" class=\"wp-image-18909\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18882-9.png\" \/><\/strong><\/p>\n<p>The highlighted portion of this output verifies that all the specified files have been successfully downloaded to our Linux Mint 21 system.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"611\" height=\"367\" class=\"wp-image-18911\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18882-10.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18882-10.png 611w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18882-10-300x180.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18882-10-501x300.png 501w\" sizes=\"auto, (max-width: 611px) 100vw, 611px\" \/><\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>This article discussed the usage of the Wget command in Linux Mint 21 for downloading files. In this regard, we shared with you two different methods with which you can download a single as well as multiple files on your system by making use of this command. As per your requirements, you can pick either of these methods and get your work done.<\/p>","protected":false},"excerpt":{"rendered":"<p>This article discussed the usage of the Wget command in Linux Mint 21 that allows us to download our desired files from the Internet.<\/p>","protected":false},"author":3,"featured_media":18947,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1049],"tags":[],"class_list":["post-18882","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux-commands"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/18882","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=18882"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/18882\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/18947"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=18882"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=18882"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=18882"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}