当前位置:   article > 正文

Linux命令(82)之wget_linux wget

linux wget

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

  1. [root@centos79-3 yum.repos.d]# wget https://mirrors.aliyun.com/repo/Centos-7.repo -O /etc/yum.repos.d/CentOS-Base.repo
  2. --2023-09-11 16:01:15-- https://mirrors.aliyun.com/repo/Centos-7.repo
  3. Resolving mirrors.aliyun.com (mirrors.aliyun.com)... 111.32.210.188, 111.32.210.193, 111.32.210.187, ...
  4. Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|111.32.210.188|:443... connected.
  5. HTTP request sent, awaiting response... 200 OK
  6. Length: 2523 (2.5K) [application/octet-stream]
  7. Saving to: ‘/etc/yum.repos.d/CentOS-Base.repo’
  8. 100%[=========================================================>] 2,523 --.-K/s in 0s
  9. 2023-09-11 16:01:16 (67.3 MB/s) - /etc/yum.repos.d/CentOS-Base.repo’ saved [2523/2523]
  10. [root@centos79-3 yum.repos.d]# ls -l /etc/yum.repos.d/CentOS-Base.repo
  11. -rw-r--r-- 1 root root 2523 Aug 4 2022 /etc/yum.repos.d/CentOS-Base.repo
  12. [root@centos79-3 yum.repos.d]#

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/256503
推荐阅读
相关标签
  

闽ICP备14008679号