Linux Command To Download File

  

Nov 23, 2018 - Explains how to download a file with curl http/ftp/sftp command line utility on a Linux, macOS, FreeBSD, OpenBSD, NetBSD and Unix-like.

How do I download a file from the internet to my linux server with Bash [closed]. Download and check the download file size. How do I download Java from the command line? If it matters, I am running CentOS v5.8. Linux centos. Share| improve this question. Edited Aug 30 '15 at 1:29. How to Search for Files from the Linux Command Line. Get up to speed with the find command so you can locate files on your Linux servers and desktops without need of a GUI. Creative Commons Zero. Learn how to use the find command in this tutorial from our archives.

I'm normally a windows user and I am currently using PuTTY to connect to a headless linux box that is running Fedora 8. I need to download the latest JDK and install it but I have to do it using the command line.

How can I do this?

Linux command to download file
JaredJared

7 Answers

You download files using the command line by using wget:

See the wget man page for options.

Dave DragerDave Drager

You can use wgetcurl: or may be lynx:

Please see the man page for options.

Ali MezganiAli Mezgani

This is why it is a good idea to install lynx on headless servers, and learn how to use lynx as well. This provides you with text-mode web browsing through a shell prompt, including the ability to download files. Because lynx is often used as the basis for web browsing for blind people, most websites do make an effort to support it.

Linux Command Line To Download File

Lynx would allow you to go to http://www.sun.com, browse to the Java download page, select what you want and download it.

Alternatively, you could download what you need onto your Windows workstation, then use pscp.exe (the scp that comes with Putty) to copy it through the ssh link to the server. That might be the easiest way to handle your particular situation today. If you want a graphical SCP client, then have a look at WinSCP.

Michael DillonMichael Dillon

You can grab a link to the download from http://java.sun.com/javase/downloads/index.jsp you need to progress through Sun's download page until you reach the actual link to the download, e.g cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/VerifyItem-Start/jdk-6u16-linux-i586.bin?BundledLineItemUUID=p5xIBe.psLUAAAEkDw4ek212&OrderID=aAtIBe.pOx4AAAEkAg4ek212&ProductID=Dx1IBe.prBgAAAEirRcTvuC_&FileName=/jdk-6u16-linux-i586.bin.

Now in your shell just type 'wget ' followed by the url. once its downloaded, execute 'sh jdk-6u16-linux-i586.bin' and run through the installer.

Jamie

For setting up Java tools on Fedora systems, I highly recommend using http://www.jpackage.org/, which will give you an RPM of the JDK you can install.

David PashleyDavid Pashley

Have you tried using the CLI package manager? For Fedora this is yum used as such:

yum search *pattern*

yum install *program*

SchmidtSchmidt

This works for me - directly from the server:

Linux Command To Download File

wget -H --follow-ftp -r http://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/VerifyItem-Start/sges-2_1_1-linux.bin?BundledLineItemUUID=KwFIBe.oLm0AAAEmpBwE680I&OrderID=aupIBe.oEnAAAAEmlBwE680I&ProductID=dc5IBe.olfwAAAEkB7xn4X5b&FileName=/sges-2_1_1-linux.bin

Jon

Not the answer you're looking for? Browse other questions tagged linuxcommand-line-interfacefedorajava or ask your own question.

wget is Linux command line utility. wget is widely used for downloading files from Linux command line. There are many options available to download a file from remote server. wget works same as open url in browser window.

Linux Command Download File To Local

Tip 1: Download File using Wget

Below example will download file from server to current local directory.

Tip 2: Download File & Save to Specific Location

Below command will download zip file in /opt folder with name file.zip. -O is used for specify destination folder

Tip 3: Download File from FTP

Some time you required to download file from ftp server, so wget can easily download file from ftp url like below.

Tip 4: Download File from Password Protected URLs

Sometimes we required to specify username and password to download a file. While using browser its easy but using command line it doesn’t prompt for login credentials. Below examples will show to how to use username,password while downloading files from password protected sources.

Tip 4.1: Download file from Password protected ftp server.

Tip 4.2: Download file from password protected http server.

Tip 4.3: Download file behind password protected proxy server.

Tip 5: Download File from Untrusted Secure URL.

Linux Command To Download File From Server To Local Machine

If any download url is using untrusted ssl certificate, wget will not download that file. But we can download it by using –no-check-certificate parameter in url.