linux命令之wget
1.wget介绍
linux命令wget用来从指定的URL下载文件。wget对网络有非常强的适应性,假设由于网络的原因下载失败,wget会不断的尝试,直到整个文件下载完毕。
2.wget用法
wget [参数] URL
wget常用参数
参数 说明
-O 将文件写入指定的file
-c 断点续传下载文件
URL:下载指定的URL地址
3.实例
3.1.下载新的CentOS-Base.repo 到 /etc/yum.repos.d/
命令:
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
OR
wget https://mirrors.aliyun.com/repo/Centos-7.repo -O /etc/yum.repos.d/CentOS-Base.repo
[root@centos79-3 yum.repos.d]# wget https://mirrors.aliyun.com/repo/Centos-7.repo -O /etc/yum.repos.d/CentOS-Base.repo
--2023-09-11 16:01:15-- https://mirrors.aliyun.com/repo/Centos-7.repo
Resolving mirrors.aliyun.com (mirrors.aliyun.com)... 111.32.210.188, 111.32.210.193, 111.32.210.187, ...
Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|111.32.210.188|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2523 (2.5K) [application/octet-stream]
Saving to: ‘/etc/yum.repos.d/CentOS-Base.repo’
100%[=========================================================>] 2,523 --.-K/s in 0s
2023-09-11 16:01:16 (67.3 MB/s) - ‘/etc/yum.repos.d/CentOS-Base.repo’ saved [2523/2523]
[root@centos79-3 yum.repos.d]# ls -l /etc/yum.repos.d/CentOS-Base.repo
-rw-r--r-- 1 root root 2523 Aug 4 2022 /etc/yum.repos.d/CentOS-Base.repo
[root@centos79-3 yum.repos.d]#
————————————————
版权声明:本文为CSDN博主「小黑要上天」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/z19861216/article/details/132811028