{"id":7076,"date":"2019-01-02T02:17:34","date_gmt":"2019-01-02T02:17:34","guid":{"rendered":"https:\/\/www.appservgrid.com\/paw92\/?p=7076"},"modified":"2019-01-08T10:28:51","modified_gmt":"2019-01-08T10:28:51","slug":"centos-wget-install-and-usage-linux-hint","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/01\/02\/centos-wget-install-and-usage-linux-hint\/","title":{"rendered":"CentOS Wget Install and Usage \u2013 Linux Hint"},"content":{"rendered":"<p>When working with Linux, especially on the professional and enterprise environment, there\u2019s always the necessity of downloading a number of files from the internet time to time. Especially in the professional environment that requires a lot of scripting, a suitable download manager is always welcome.<\/p>\n<p>For the enterprise, RHEL is the most suitable one as it\u2019s well maintained with tons of support from both the community and the developers. CentOS, on the other hand, is the free edition of RHEL that offers a great ground for practicing and getting a grab of the enterprise environment.<\/p>\n<p>Are you a CentOS user? So am I! I recently started my journey with CentOS on my virtual machine.<\/p>\n<p>For scripting and other purposes, \u201cwget\u201d is an extremely suitable choice. Wget is a part of the GNU Project software that offers a very basic download manager. It\u2019s free and open-source and capable of handling all the popular Internet protocols like HTTP, HTTPS, FTP and FTPS.<\/p>\n<p>Wget is a non-interactive command-line tool. That makes it extremely suitable for almost any purpose. Let\u2019s get wget in our CentOS!<\/p>\n<p>By default, CentOS should come up with wget. Make sure that your system comes up with wget by running the following command \u2013<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2019\/01\/1-3.png\" alt=\"\" width=\"725\" height=\"217\" \/><\/p>\n<p>If you didn\u2019t get the result, you should install wget into your system right now!<\/p>\n<h2>Installing Wget<\/h2>\n<p>There are 2 different ways of installing wget into your system \u2013 installing from CentOS repository or, building it from source.<\/p>\n<h3>Grabbing wget from CentOS repo<\/h3>\n<p>At first, make sure that your system is up-to-date \u2013<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2019\/01\/2-3.png\" alt=\"\" width=\"877\" height=\"209\" \/><\/p>\n<p>Then, run the command for installing wget \u2013<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2019\/01\/3-3.png\" alt=\"\" width=\"876\" height=\"593\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2019\/01\/4-3.png\" alt=\"\" width=\"876\" height=\"482\" \/><\/p>\n<ul>\n<li>Installing from source<\/li>\n<\/ul>\n<p>This method applies to all the other Linux distros as well. We have to grab the source code and build it in our system.<\/p>\n<p>Make sure that your CentOS system comes up with all the necessary development tools \u2013<\/p>\n<p>sudo yum groupinstall \u201cDevelopment Tools\u201d<br \/>\nsudo yum install glibc-devel glibc-headers kernel-headers kernel-devel gnutls-devel<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2019\/01\/5-3.png\" alt=\"\" width=\"876\" height=\"592\" \/><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2019\/01\/6-3.png\" alt=\"\" width=\"880\" height=\"601\" \/><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2019\/01\/7-3.png\" alt=\"\" width=\"876\" height=\"593\" \/><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2019\/01\/8-4.png\" alt=\"\" width=\"877\" height=\"596\" \/><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2019\/01\/9-3.png\" alt=\"\" width=\"876\" height=\"592\" \/><\/p>\n<p>Grab the source code from the <a href=\"https:\/\/ftp.gnu.org\/gnu\/wget\/\">official GNU FTP server<\/a> \u2013<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2019\/01\/10-2.png\" alt=\"\" width=\"456\" height=\"330\" \/><\/p>\n<p>Then, extract the source code \u2013<\/p>\n<p>tar -xvzf wget-latest.tar.gz<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2019\/01\/11-2.png\" alt=\"\" width=\"878\" height=\"595\" \/><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2019\/01\/12-2.png\" alt=\"\" width=\"880\" height=\"599\" \/><\/p>\n<p>Now, start the building process \u2013<\/p>\n<p>cd wget-1.20\/<br \/>\n.\/configure<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2019\/01\/13-2.png\" alt=\"\" width=\"879\" height=\"593\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2019\/01\/14-2.png\" alt=\"\" width=\"876\" height=\"599\" \/><\/p>\n<p>Finally, perform the installation \u2013<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2019\/01\/15-2.png\" alt=\"\" width=\"875\" height=\"595\" \/><\/p>\n<h3>Wget usage<\/h3>\n<p>Wget is a very simple tool to use. Generally, all you need to tell is the download link of the file. For example, let\u2019s download the source code of \u201cwget\u201d once again \u2013<\/p>\n<p>wget ftp.gnu.org\/gnu\/wget\/wget-latest.tar.gz<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2019\/01\/17-1.png\" alt=\"\" width=\"875\" height=\"323\" \/><\/p>\n<p>There are also a number of other advanced options available. For example, you can set the file name of the download into a different one using \u201c-O\u201d flag.<\/p>\n<p>wget -O wget-source.tar.gz ftp.gnu.org\/gnu\/wget\/wget-1.19.tar.gz<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2019\/01\/18-1.png\" alt=\"\" width=\"886\" height=\"357\" \/><\/p>\n<p>Need to download multiple files? Just state their respective download URLs one after another!<\/p>\n<p>wget ftp.gnu.org\/gnu\/wget\/wget-1.6.tar.gz ftp.gnu.org\/gnu\/wget\/wget-1.7.tar.gz<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2019\/01\/19-1.png\" alt=\"\" width=\"881\" height=\"552\" \/><\/p>\n<p>It\u2019s also possible to download all the links from a file. For example,<\/p>\n<p># download.txt<br \/>\nhttps:\/\/ftp.gnu.org\/gnu\/wget\/wget-1.6.tar.gz<br \/>\nhttps:\/\/ftp.gnu.org\/gnu\/wget\/wget-1.7.tar.gz<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2019\/01\/20-1.png\" alt=\"\" width=\"906\" height=\"133\" \/><\/p>\n<p>Now, tell wget to use the file as the source of download URLs \u2013<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2019\/01\/21-1.png\" alt=\"\" width=\"878\" height=\"592\" \/><\/p>\n<p>For an in-depth guide on wget, you should use the \u201cwget\u201d help page.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2019\/01\/22.png\" alt=\"\" width=\"875\" height=\"597\" \/><\/p>\n<p>Enjoy!<\/p>\n<p><a href=\"https:\/\/linuxhint.com\/centos_wget_install\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>When working with Linux, especially on the professional and enterprise environment, there\u2019s always the necessity of downloading a number of files from the internet time to time. Especially in the professional environment that requires a lot of scripting, a suitable download manager is always welcome. For the enterprise, RHEL is the most suitable one as &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/01\/02\/centos-wget-install-and-usage-linux-hint\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;CentOS Wget Install and Usage \u2013 Linux Hint&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7076","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/7076","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=7076"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/7076\/revisions"}],"predecessor-version":[{"id":7399,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/7076\/revisions\/7399"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=7076"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=7076"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=7076"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}