diff --git a/docs/curl.html b/docs/curl.html index 1011c886..dc6c15cb 100644 --- a/docs/curl.html +++ b/docs/curl.html @@ -228,6 +228,38 @@
curl -o /dev/null --silent -Iw "%{http_code}" https://example.com/my.remote.tarball.gz
 
+

正在下载文件

+ +
curl https://example.com | \
+grep --only-matching 'src="[^"]*.[png]"' | \
+cut -d\" -f2 | \
+while read i; do curl https://example.com/"${i}" \
+-o "${i##*/}"; done
+
+

从站点下载所有 PNG 文件(使用GNU grep)

+

下载文件,保存文件而不更改其名称

+ +
curl --remote-name "https://example.com/linux-distro.iso"
+
+

重命名文件

+
curl --remote-name "http://example.com/index.html" --output foo.html
+
+

继续部分下载

+ +
curl --remote-name --continue-at - "https://example.com/linux-distro.iso"
+
+ +

从多个域下载文件

+ +
curl "https://www.{example,w3,iana}.org/index.html" --output "file_#1.html"
+
+ +

下载一系列文件

+ +
curl "https://{foo,bar}.com/file_[1-4].webp" --output "#1_#2.webp"
+
+ +

下载一系列文件(输出foo_file1.webpfoo_file2.webp…bar_file1_webp等)