Get the App
SLTechnology News&Howtos  ›  Servers  › 

A case of downloading files on the Linux command line

Shulou Source: shulou.com Published: 2022-06-02 00:30:30 10月04日 Update

This article is about downloading files from the Linux command line. The editor thought it was very practical, so I shared it with you as a reference. Let's follow the editor and have a look.

Wget is a Linux command line utility that is widely used to download files from the Linux command line, and there are many options for downloading files from a remote server. Wget is the same as open url in the browser window.

1: download files using Wget

The following example downloads the file from the server to the current local directory.

$wget https://tecadmin.net/file.zip

2: download the file and save it to a specific location

The following command downloads the zip file in the / opt folder named file.zip. -O used to specify the destination folder

# wget https://tecadmin.net/file.zip-O / opt/file.zip

3: download files from FTP

Sometimes you need to download files from a ftp server, so wget can easily download files from ftp url, as shown below.

# wget ftp://ftp.tecadmin.net/file.zip

4: download files from password-protected URL

Sometimes we need to specify a user name and password to download the file. Although it is easy to use the browser but use the command line, it does not prompt for login credentials. The following example shows how to use a user name and password when downloading a file from a password-protected source.

Download files from a password-protected ftp server.

$wget-- ftp-user=username-- ftp-password=secretpassword ftp://ftp.tecadmin.net/file.zipor$ wget ftp://username:secretpassword@ftp.tecadmin.net/file.zip

Download files from a password-protected http server.

# wget-http-user=username-http-password=secretpassword https://tecadmin.net/file.zipor# wget-user=username-password=secretpassword https://tecadmin.net/file.zip

4.3: download the file behind the password-protected proxy server.

$wget-proxy-user=username-proxy-password=secretpassword https://tecadmin.net/file.zip

5: download files from an untrusted secure URL.

If any download URL uses an untrusted ssl certificate, wget will not download the file. But we can download it in url using the-no-check-certificate parameter.

$wget https://tecadmin.net/file.zip-no-check-certificate Thank you for your reading! This is the case of downloading files on the Linux command line. I hope the above content can be helpful to you, so that you can learn more knowledge. If you think the article is good, you can share it and let more people see it.

Tags: File password command server service password protection face-to-face up and down case utility content folder more browser user name sample browsing good Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Shulou Information Docker Shulou Technology MariaDB