Usage: wget [OPTION]... [URL]...
# 后台运行
-b, --background go to background after startup
# log信息打印
-o, --output-file=FILE log messages to FILE
-a, --append-output=FILE append messages to FILE
-d, --debug print lots of debugging information
-q, --quiet quiet (no output)
# url来源文件
-i, --input-file=FILE download URLs found in local or external FILE
-F, --force-html treat input file as HTML
-B, --base=URL resolves HTML input-file links (-i -F)
# 下载回复
-O, --output-document=FILE write documents to FILE
-c, --continue resume getting a partially-downloaded file # 断电续传
--start-pos=OFFSET start downloading from zero-based position OFFSET
--progress=TYPE select progress gauge type
--show-progress display the progress bar in any verbosity mode
-N, --timestamping don't re-retrieve files unless newer than local # 不下载早于的时间戳
--no-if-modified-since don't use conditional if-modified-since get requests in timestamping mode # 自从上次下载未进行修改
--no-use-server-timestamps don't set the local file's timestamp by the one on the server # 不使用服务器提供的时间戳
# 响应response
-S, --server-response print server response
--spider don't download anything
# 下载速率设置...
-Q, --quota=NUMBER set retrieval quota to NUMBER # 设置递归层数
--bind-address=ADDRESS bind to ADDRESS (hostname or IP) on local host # 绑定ip访问,即以ip进行下载数据
--limit-rate=RATE limit download rate to RATE # 下载速率
--no-dns-cache disable caching DNS lookups # 不使用dns缓存,直接进行dns查询
--restrict-file-names=OS restrict chars in file names to ones OS allows # 使用系统所限制字符
--ignore-case ignore case when matching files/directories # 忽略大小写
# Http请求头设置
-E,
--header=STRING insert STRING among the headers
--compression=TYPE choose compression, one of auto, gzip and none. (default: none)
--max-redirect maximum redirections allowed per page # 最大次数进行重定向
--proxy-user=USER set USER as proxy username
--proxy-password=PASS set PASS as proxy password
--referer=URL include 'Referer: URL' header in HTTP request
--save-headers save the HTTP headers to file
-U, --user-agent=AGENT identify as AGENT instead of Wget/VERSION
--no-http-keep-alive disable HTTP keep-alive (persistent connections)
--no-cookies don't use cookies
--load-cookies=FILE load cookies from FILE before session
--save-cookies=FILE save cookies to FILE after session
--keep-session-cookies load and save session (non-permanent) cookies
--post-data=STRING use the POST method; send STRING as the data
--post-file=FILE use the POST method; send contents of FILE
--method=HTTPMethod use method "HTTPMethod" in the request
--body-data=STRING send STRING as data. --method MUST be set
--body-file=FILE send contents of FILE. --method MUST be set
--content-disposition honor the Content-Disposition header when
choosing local file names (EXPERIMENTAL)
--content-on-error output the received content on server errors
--auth-no-challenge send Basic HTTP authentication information
without first waiting for the server's
challenge
参考:linux下载命令
使用wget -Q
限制总下载文件大小
==当你想要下载的文件超过5M而退出下载,你可以使用以下命令:==
wget -Q5m -i filelist.txt
注意:这个参数对单个文件下载不起作用,只能递归下载时才有效。
使用wget -r -A
下载指定格式文件
可以在以下情况使用该功能
wget -p /path -A "*.png" url
wget -p /path -A png,jpg url
你甚至可以用wget下载完整的站点, 然后进行离线浏览. 方法是使用如下命令:
wget --mirror --convert-links --page-requisites --no-parent -P /path/to/download https://example-domain.com
--mirror 会开启镜像所需要的所有选项.
--convert-links 会将所有链接转换成本地链接以便离线浏览.
--page-requisites 表示下载包括CSS样式文件,图片等所有所需的文件,以便离线时能正确地现实页面.
--no-parent 用于限制只下载网站的某一部分内容.
-P设置下载路径.
tar
-c: 建立压缩档案
-x:解压
-t:查看内容
-r:向压缩归档文件末尾追加文件
-u:更新原压缩包中的文件
这五个是独立的命令,压缩解压都要用到其中一个,可以和别的命令连用但只能用其中一个。下面的参数是根据需要在压缩或解压档案时可选的。
-z:有gzip属性的
-j:有bz2属性的
-Z:有compress属性的
-v:显示所有过程
-O:将文件解开到标准输出
下面的参数-f是必须的
-f: 使用档案名字,切记,这个参数是最后一个参数,后面只能接档案名。
tar –xvf
解压gzip -d
或者gunzip
解压tar –xzf
解压bzip2 -d
或者用bunzip2
解压tar –xjf
解压uncompress
解压tar –xZf
解压unrar e
解压unzip
解压unzip -n test.zip
unzip -n -d /temp test.zip
只看一下zip压缩包中包含哪些文件,不进行解压缩unzip -l test.zip
查看显示的文件列表还包含压缩比率unzip -v test.zip
检查zip文件是否损坏unzip -t test.zip
如果已有相同的文件存在,要求unzip命令覆盖原先的文件unzip -o test.zip -d /tmp/
示例:
eg1: unzip mydata.zip -d mydatabak #解压到mydatabak目录
$ xz -d node-v6.10.1-linux-x64.tar.xz
$ tar -xvf node-v6.10.1-linux-x64.tar
原文:https://www.cnblogs.com/guanyuespace/p/wget_tar.html