CentOS7.5 by wget to download files to the specified directory

In the Linux command line below to download files through a simple wget it is relatively common, such as in CentOS7 also inside.
We first look at their CentOS7 system has not been installed wget:

[root @ the Test Redis] # RPM -qa | grep wget
1
currently installed version if you will be prompted to install:

1.14-15.el7_4.1.x86_64-wget
1
is not installed, then you can install with the following command:

-y install wget yum
1
installed wget, we want to download the file, usually wget http: download //wwww.xxxxx this format to the default download directory.

What if we want to download it to a specific directory? By -P parameter:

Command: catalog file wget -P / save file Download

-P followed is that you need a directory to save the file, such as / home / tmp / download, and the last argument is that you actually want to download network file url address, such as the following command to download the 6.4 version of the package to tar elasticsearch / home / tmp / download directory:

[root @ the Test Redis] # wget -P / Home / tmp / download https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.4.2.tar.gz
--2018-10-15 13:58: 40-- https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.4.2.tar.gz
Resolving host artifacts.elastic.co (artifacts.elastic.co) ... 107.21.127.184, 54.225 . 221.128, 107.21.237.188, ...
connecting artifacts.elastic.co (artifacts.elastic.co) | 107.21.127.184 |: 443 ... connected.
HTTP request has been issued, awaiting response ... 200 OK
length: 97914519 (93M) [application / x-gzip]
is saved to: "/home/tmp/download/elasticsearch-6.4.2.tar.gz"
- --------------
Disclaimer: this article is CSDN blogger "Satsuki donor" of the original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement. .
Original link: https: //blog.csdn.net/xiaocy66/java/article/details/83058166

Guess you like

Origin www.cnblogs.com/telwanggs/p/12666639.html