{"id":1564,"date":"2021-12-16T12:07:33","date_gmt":"2021-12-16T09:07:33","guid":{"rendered":"https:\/\/files2.tojikon.net\/files-cloud\/2021\/04\/29\/how-to-download-files-on-linux-with-curl\/https:\/\/files2.tojikon.net\/files-cloud\/2021\/04\/29\/how-to-download-files-on-linux-with-curl\/"},"modified":"2021-12-16T12:07:33","modified_gmt":"2021-12-16T09:07:33","slug":"how-to-download-files-on-linux-with-curl","status":"publish","type":"post","link":"https:\/\/tojikon.net\/en\/1564-how-to-download-files-on-linux-with-curl\/","title":{"rendered":"How to download files on Linux with Curl"},"content":{"rendered":"<section id=\"related_posts\">\n<div class=\"block-head\">\n<h3>Related Articles<\/h3>\n<\/div>\n<\/section>\n<p>Curl is one of the most used Linux utilities ever. It\u2019s built-in so many GUI tools and used on pretty much everything. As a result, it is very reliable and one of the best tools users can use to download files.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-400894 size-full\" src=\"https:\/\/files2.tojikon.net\/files-cloud\/wp-content\/uploads\/2021\/12\/how-to-download-files-on-linux-with-curl.png\" alt=\"download files on Linux with Curl\" width=\"1200\" height=\"465\" srcset=\"https:\/\/files2.tojikon.net\/files-cloud\/wp-content\/uploads\/2021\/12\/how-to-download-files-on-linux-with-curl.png 1200w, https:\/\/files2.tojikon.net\/files-cloud\/wp-content\/uploads\/2021\/12\/how-to-download-files-on-linux-with-curl-6.png 300w, https:\/\/files2.tojikon.net\/files-cloud\/wp-content\/uploads\/2021\/12\/how-to-download-files-on-linux-with-curl-9.png 1024w, https:\/\/files2.tojikon.net\/files-cloud\/wp-content\/uploads\/2021\/12\/how-to-download-files-on-linux-with-curl-10.png 768w\" sizes=\"(max-width: 1200px) 100vw, 1200px\"\/><\/p>\n<p>In this guide, we\u2019ll show you how the Curl program works and how to use it to download files with it. We\u2019ll even go over a neat GUI Curl app!<\/p>\n<p>Need to use Curl on Windows 10? Check out this guide.<\/p>\n<h2>Installing Curl<\/h2>\n<p>Although Curl is arguably one of the most used programs on all of Linux, it doesn\u2019t always come pre-installed. As a result, we must walk you through how to install Curl before demonstrating how it works.<\/p>\n<p>To install Curl on your Linux PC, open up a terminal window by pressing <strong>Ctrl + Alt + T<\/strong> . After that, follow the installation instructions outlined below that corresponds with the operating system you currently use.<\/p>\n<h4>Ubuntu<\/h4>\n<p>On Ubuntu, install Curl with the\u00a0<strong>Apt\u00a0<\/strong>command.<\/p>\n<pre>\nsudo apt install curl\n<\/pre>\n<h4>Debian<\/h4>\n<p>On Debian, get Curl working with\u00a0<strong>Apt-get<\/strong>.<\/p>\n<pre>\nsudo apt-get install curl\n<\/pre>\n<h4>Arch Linux<\/h4>\n<p>Those on Arch Linux can install Curl with\u00a0<strong>Pacman<\/strong>.<\/p>\n<pre>\nsudo pacman -S curl\n<\/pre>\n<h4>Fedora<\/h4>\n<p>If you\u2019re on Fedora, you can install Curl with\u00a0<strong>Dnf<\/strong>.<\/p>\n<pre>\nsudo dnf install curl\n<\/pre>\n<h4>OpenSUSE<\/h4>\n<p>On OpenSUSE, install Curl with the\u00a0<strong>Zypper\u00a0<\/strong>command.<\/p>\n<pre>\nsudo zypper install curl\n<\/pre>\n<h2>Download with Curl \u2013 command-line\u00a0<\/h2>\n<p>If you\u2019re new to Curl, start by opening up the terminal. You can open up a terminal window on the Linux desktop by pressing the\u00a0<strong>Ctrl + Alt + T\u00a0<\/strong>keyboard combination. Alternatively, search for \u201cTerminal\u201d in the app menu.<\/p>\n<p>With the terminal window open, use the\u00a0<strong>man curl\u00a0<\/strong>command to view the Curl manual. Please read it, and familiarize yourself with the app. After that, follow along with the sections below to learn how to download files with Curl in the terminal.<\/p>\n<h3>Downloading a single file<\/h3>\n<p>Downloading a single file with Curl is very straightforward. To start, you must specify the URL of the file. For example, to download a Ubuntu 20.04 LTS ISO, you\u2019d specify the URL like so.<\/p>\n<pre>\ncurl https:\/\/mirror.math.princeton.edu\/pub\/ubuntu-iso\/20.04\/ubuntu-20.04.2.0-desktop-amd64.iso\n<\/pre>\n<p>After specifying the remote URL of the file you wish to download, you must select a download location. To set the download location, add a <strong>&gt;\u00a0<\/strong>symbol, followed by the path where the file should go.<\/p>\n<p>For example, to tell your Ubuntu 20.04 LTS ISO file to download to the \u201cDownloads\u201d directory, you\u2019d add in <code>&gt; ~\/Downloads\/ubuntu-20.04.2.0-desktop-amd64.iso<\/code>.<\/p>\n<pre>\ncurl https:\/\/mirror.math.princeton.edu\/pub\/ubuntu-iso\/20.04\/ubuntu-20.04.2.0-desktop-amd64.iso &gt; ~\/Downloads\/ubuntu-20.04.2.0-desktop-amd64.iso\n<\/pre>\n<p>Once the command has the remote file\u2019s URL and where to save it, press the <strong>Enter\u00a0<\/strong>key to execute the download. Soon after, you\u2019ll see download progress, as well as your file downloading. When it is complete, open up the Linux file manager to access your file.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-400894 size-full\" src=\"https:\/\/files2.tojikon.net\/files-cloud\/wp-content\/uploads\/2021\/12\/how-to-download-files-on-linux-with-curl.png\" alt=\"\" width=\"1200\" height=\"465\" srcset=\"https:\/\/files2.tojikon.net\/files-cloud\/wp-content\/uploads\/2021\/12\/how-to-download-files-on-linux-with-curl.png 1200w, https:\/\/files2.tojikon.net\/files-cloud\/wp-content\/uploads\/2021\/12\/how-to-download-files-on-linux-with-curl-6.png 300w, https:\/\/files2.tojikon.net\/files-cloud\/wp-content\/uploads\/2021\/12\/how-to-download-files-on-linux-with-curl-9.png 1024w, https:\/\/files2.tojikon.net\/files-cloud\/wp-content\/uploads\/2021\/12\/how-to-download-files-on-linux-with-curl-10.png 768w\" sizes=\"(max-width: 1200px) 100vw, 1200px\"\/><\/p>\n<h3>Downloading multiple files from a list<\/h3>\n<p>It is possible to download multiple files from a list in Curl just like Wget. To do it, start by creating your list. First, use the\u00a0<strong>touch\u00a0<\/strong>command to create a blank text file with the name \u201ccurl_downloads.txt.\u201d<\/p>\n<pre>\ntouch ~\/curl_downloads.txt\n<\/pre>\n<p>Next, open up the \u201ccurl_downloads.txt\u201d text file (located in your Home folder) using your favorite text editor. After that, paste in links to each file you wish to download.\u00a0<\/p>\n<p>For example, to download an Ubuntu ISO, a Fedora ISO, and a Debian ISO, my \u201ccurl_downloads.txt\u201d list should have the following code.<\/p>\n<p><code>https:\/\/mirror.math.princeton.edu\/pub\/ubuntu-iso\/20.04\/ubuntu-20.04.2.0-desktop-amd64.iso<\/code><\/p>\n<p><code>https:\/\/download.fedoraproject.org\/pub\/fedora\/linux\/releases\/33\/Workstation\/x86_64\/iso\/Fedora-Workstation-Live-x86_64-33-1.2.iso<\/code><\/p>\n<p><code>https:\/\/cdimage.debian.org\/debian-cd\/current\/amd64\/iso-cd\/debian-10.9.0-amd64-netinst.iso<\/code><\/p>\n<p>Save the edits to your \u201ccurl_downloads.txt\u201d file using your text editor\u2019s save function. Then, feed it into the Curl command to download everything on the list. Please note that we\u2019re using\u00a0<strong>xargs\u00a0<\/strong>in combination with\u00a0<strong>curl\u00a0<\/strong>to make it possible to download multiple files.<\/p>\n<pre>\nxargs -n 1 curl -O &lt; ~\/curl_downloads.txt\n<\/pre>\n<p>Press the\u00a0<strong>Enter\u00a0<\/strong>key to begin the download process. Please understand that while using the\u00a0<strong>xargs\u00a0<\/strong>command to download multiple files, specifying a download location isn\u2019t possible. Your downloads will appear in the Home directory (\/home\/USERNAME\/).<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-400893 size-full\" src=\"https:\/\/files2.tojikon.net\/files-cloud\/wp-content\/uploads\/2021\/12\/how-to-download-files-on-linux-with-curl-2.png\" alt=\"\" width=\"1200\" height=\"528\" srcset=\"https:\/\/files2.tojikon.net\/files-cloud\/wp-content\/uploads\/2021\/12\/how-to-download-files-on-linux-with-curl-2.png 1200w, https:\/\/files2.tojikon.net\/files-cloud\/wp-content\/uploads\/2021\/12\/how-to-download-files-on-linux-with-curl-12.png 300w, https:\/\/files2.tojikon.net\/files-cloud\/wp-content\/uploads\/2021\/12\/how-to-download-files-on-linux-with-curl-14.png 1024w, https:\/\/files2.tojikon.net\/files-cloud\/wp-content\/uploads\/2021\/12\/how-to-download-files-on-linux-with-curl-15.png 768w\" sizes=\"(max-width: 1200px) 100vw, 1200px\"\/><\/p>\n<h2>Downloading with Curl \u2013 GUI<\/h2>\n<p>If you like the idea of Curl but would prefer a GUI to download files, you can use the Curl GUI application. It is a beta app from way back in 2007, but it still works on modern Linux OSes and adds a friendly GUI to Curl.<\/p>\n<p>To start, you must install the program. The program is a Perl script, and it requires the \u201cperl-tk\u201d package to run. To install it, open up a terminal window and enter the command below that corresponds with your OS.<\/p>\n<h4>Ubuntu<\/h4>\n<pre>\nsudo apt install perl-tk\n<\/pre>\n<h4>Debian<\/h4>\n<pre>\nsudo apt-get install perl-tk\n<\/pre>\n<h4>Arch Linux<\/h4>\n<pre>\nsudo pacman -S perl-tk\n<\/pre>\n<h4>Fedora<\/h4>\n<pre>\nsudo dnf install perl-Tk\n<\/pre>\n<h4>OpenSUSE<\/h4>\n<pre>\nsudo zypper install perl-Tk\n<\/pre>\n<p>Next, create a new directory in the \/opt\/ folder using\u00a0<strong>mkdir<\/strong>.<\/p>\n<pre>\nsudo mkdir -p \/opt\/curl-gui\/\n<\/pre>\n<p>Use the\u00a0<strong>CD\u00a0<\/strong>command to move into the new folder. Then use\u00a0<strong>wget\u00a0<\/strong>to download the script file.<\/p>\n<pre>\ncd \/opt\/curl-gui\/\n<\/pre>\n<pre>\nwget https:\/\/archive.org\/download\/curl-gui\/curl-gui.pl\n<\/pre>\n<p>Then, download the shortcut file and mark it executable.\u00a0<\/p>\n<pre>\ncd \/usr\/share\/applications\/\nwget https:\/\/archive.org\/download\/curl-gui_202104\/curl-gui.desktop\nsudo chmod +x curl-gui.desktop\n<\/pre>\n<p>Once the app is installed, search for \u201ccURL GUI\u201d in your app menu and click on it to launch the app. Then, inside the app, locate the text box at the top and paste your download link into it.<\/p>\n<p>After pasting your download link, find \u201cOutput file\u201d and check the box. Then, write in the name of the output file. For example, if you\u2019re downloading an Ubuntu ISO, add \u201c\/home\/USERNAME\/Downloads\/ubuntu-20.04.2.0-desktop-amd64.iso\u201d after \u201cOutput.\u201d<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-400892 size-full\" src=\"https:\/\/files2.tojikon.net\/files-cloud\/wp-content\/uploads\/2021\/12\/how-to-download-files-on-linux-with-curl-4.png\" alt=\"\" width=\"1200\" height=\"750\" srcset=\"https:\/\/files2.tojikon.net\/files-cloud\/wp-content\/uploads\/2021\/12\/how-to-download-files-on-linux-with-curl-4.png 1200w, https:\/\/files2.tojikon.net\/files-cloud\/wp-content\/uploads\/2021\/12\/how-to-download-files-on-linux-with-curl-16.png 300w, https:\/\/files2.tojikon.net\/files-cloud\/wp-content\/uploads\/2021\/12\/how-to-download-files-on-linux-with-curl-17.png 1024w, https:\/\/files2.tojikon.net\/files-cloud\/wp-content\/uploads\/2021\/12\/how-to-download-files-on-linux-with-curl-18.png 768w\" sizes=\"(max-width: 1200px) 100vw, 1200px\"\/><\/p>\n<p>Click \u201cSTART curl\u201d to start your download. When the download is complete, close the app and open up the Linux file manager to access your downloaded file.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Related Articles Curl is one of the most used Linux utilities ever. It\u2019s built-in so many GUI tools and used on pretty much everything. As a result, it is very reliable and one of the best tools users can use to download files. In this guide, we\u2019ll show you how the Curl program works and &hellip;<\/p>\n","protected":false},"author":1,"featured_media":1565,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[21],"tags":[33],"_links":{"self":[{"href":"https:\/\/tojikon.net\/en\/wp-json\/wp\/v2\/posts\/1564"}],"collection":[{"href":"https:\/\/tojikon.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tojikon.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tojikon.net\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tojikon.net\/en\/wp-json\/wp\/v2\/comments?post=1564"}],"version-history":[{"count":0,"href":"https:\/\/tojikon.net\/en\/wp-json\/wp\/v2\/posts\/1564\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tojikon.net\/en\/wp-json\/wp\/v2\/media\/1565"}],"wp:attachment":[{"href":"https:\/\/tojikon.net\/en\/wp-json\/wp\/v2\/media?parent=1564"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tojikon.net\/en\/wp-json\/wp\/v2\/categories?post=1564"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tojikon.net\/en\/wp-json\/wp\/v2\/tags?post=1564"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}