linux's docs

10.2.1: 扩展-WGET命令

1. wget

语法:wget [参数] URL

  • -0 filename/-,前者是重定向到filename中,后者是直接重定向到stdout
  • -q,等同于--quiet,关闭wget的输出信息


# -O 直接指定文件
wget -O image

file image
image: PNG image data, 2240 x 550, 8-bit/color RGB, non-interlaced

# -O 后面不跟文件跟'-'
wget -qO- 
# 下载下来的文件会以系统stdout的方式显示出来

# docker的安装示例
wget -qO- |sh
+ sh -c 'sleep 3; yum -y -q install docker-engine'
warning: /var/cache/yum/x86_64/7/docker-main-repo/packages/docker-engine-1.8.2-1.el7.centos.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID 2c52609d: NOKEY
Public key for docker-engine-1.8.2-1.el7.centos.x86_64.rpm is not installed
Importing GPG key 0x2C52609D:
 Userid     : "Docker Release Tool (releasedocker) <>"
 Fingerprint: 5811 8e89 f3a9 1289 7c07 0adb f762 2157 2c52 609d
 From       :

If you would like to use Docker as a non-root user, you should now consider
adding your user to the "docker" group with something like:

  sudo usermod -aG docker your-user

Remember that you will have to log out and back in for this to take effect!