Use the wget command to download files to a remote Unix/Linux workstation

in

Suppose you're working on a Unix/Linux machine remotely through an SSH session, and then you need to get a resource (like a tar or gzip file) that's on the Internet to that machine. Well, you could download that file to your local machine, and then use scp to copy it to your remote Unix box. Or ... you can get the URL for the resource on your local workstation, copy the URL, and then use wget on the remote workstation and download it directly to that machine.

For instance, I just needed to get a Ruby resource on a local Linux workstation. I just followed these steps:

  • On my local Windows workstation I worked until I found the need URL I needed, which in this case was "http://tmtm.org/downloads/mysql/ruby/mysql-ruby-2.7.1.tar.gz".
  • In my SSH terminal I typed this:
wget http://tmtm.org/downloads/mysql/ruby/mysql-ruby-2.7.1.tar.gz

I should also note that you can use w3m on the remote machine as well. I just can't use that as fast as I can use a GUI browser, like Firefox.

As soon as the download was completed I had the file I needed on my remote server, with no need for the etxra scp step.

One thing to know is that this will leave a record in the remote
system's access log files, showing the hit coming from the remote
system where you ran the wget command. I don't think that is really a problem, but I thought I should mention it.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

Captcha
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
2 + 0 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.