一、作用
二、选项
- -O 指定保存的名字
- -b 进行后台运行
- -a<日志文件> 在指定的日志文件中记录执行过程
三、实例
```shell [root@localhost ~]# wget -O /etc/yum.repos.d/epels.repo http://mirrors.aliyun.com/repo/epel-7.repo —2022-06-17 21:07:02— http://mirrors.aliyun.com/repo/epel-7.repo 正在解析主机 mirrors.aliyun.com (mirrors.aliyun.com)… 119.96.204.213, 119.96.204.215, 202.100.222.208, … 正在连接 mirrors.aliyun.com (mirrors.aliyun.com)|119.96.204.213|:80… 已连接。 已发出 HTTP 请求,正在等待回应… 200 OK 长度:664 [application/octet-stream] 正在保存至: “/etc/yum.repos.d/epels.repo”[root@localhost ~]# wget -b http://www.linuxde.net/testfile.zip
继续在后台运行,pid 为 45158。
将把输出写入至 “wget-log”。
[root@localhost ~]# cat wget-log
--2022-06-17 21:03:40-- http://www.linuxde.net/testfile.zip
正在解析主机 www.linuxde.net (www.linuxde.net)... 23.226.62.190
正在连接 www.linuxde.net (www.linuxde.net)|23.226.62.190|:80...
100%[====================================================>] 664 —.-K/s 用时 0s
2022-06-17 21:07:02 (129 MB/s) - 已保存 “/etc/yum.repos.d/epels.repo” [664/664])
```