[研究]curl 7.76.1網路傳輸工具安裝、試用 (Rocky Linux 9.1)
2023-03-21
在 CentOS 應該也通用,不保證。
cURL - 維基百科,自由的百科全書
https://zh.wikipedia.org/zh-tw/CURL
cURL是一個開源專案,主要的產品是curl(命令列工具)和libcurl(C語言的API庫),兩者功能均是:基於網路協定,對指定URL進行網路傳輸。cURL涉及是任何網路協定傳輸,不涉及對具體資料的具體處理(如:html的彩現等)。
********************************************************************************
Default.aspx
[user1@localhost ~]$ yum -y install curl Error: This command has to be run with superuser privileges (under the root user on most systems). [user1@localhost ~]$ sudo yum -y install curl
[sudo] password for user1:
Last metadata expiration check: 0:20:50 ago on Fri 24 Mar 2023 09:44:46 AM CST.
Package curl-7.76.1-19.el9.x86_64 is already installed.
Dependencies resolved.
=========================================================================
Package Architecture Version Repository Size
=========================================================================
Upgrading:
curl x86_64 7.76.1-19.el9_1.1 baseos 295 k
libcurl x86_64 7.76.1-19.el9_1.1 baseos 285 k
Transaction Summary
=========================================================================
Upgrade 2 Packages
Total download size: 579 k
Downloading Packages:
(1/2): curl-7.76.1-19.el9_1.1.x86_64.rpm 228 kB/s | 295 kB 00:01
(2/2): libcurl-7.76.1-19.el9_1.1.x86_64. 163 kB/s | 285 kB 00:01
-------------------------------------------------------------------------
Total 211 kB/s | 579 kB 00:02
Rocky Linux 9 - BaseOS 1.7 MB/s | 1.7 kB 00:00
Importing GPG key 0x350D275D:
Userid : "Rocky Enterprise Software Foundation - Release key 2022 <releng@rockylinux.org>"
Fingerprint: 21CB 256A E16F C54C 6E65 2949 702D 426D 350D 275D
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Upgrading : libcurl-7.76.1-19.el9_1.1.x86_64 1/4
Upgrading : curl-7.76.1-19.el9_1.1.x86_64 2/4
Cleanup : curl-7.76.1-19.el9.x86_64 3/4
Cleanup : libcurl-7.76.1-19.el9.x86_64 4/4
Running scriptlet: libcurl-7.76.1-19.el9.x86_64 4/4
Verifying : libcurl-7.76.1-19.el9_1.1.x86_64 1/4
Verifying : libcurl-7.76.1-19.el9.x86_64 2/4
Verifying : curl-7.76.1-19.el9_1.1.x86_64 3/4
Verifying : curl-7.76.1-19.el9.x86_64 4/4
Upgraded:
curl-7.76.1-19.el9_1.1.x86_64 libcurl-7.76.1-19.el9_1.1.x86_64
Complete!
[user1@localhost ~]$
|
[user1@localhost ~]$ curl curl: try 'curl --help' or 'curl --manual' for more information [user1@localhost ~]$ curl --help Usage: curl [options...] <url> -d, --data <data> HTTP POST data -f, --fail Fail silently (no output at all) on HTTP errors -h, --help <category> Get help for commands -i, --include Include protocol response headers in the output -o, --output <file> Write to file instead of stdout -O, --remote-name Write output to a file named as the remote file -s, --silent Silent mode -T, --upload-file <file> Transfer local FILE to destination -u, --user <user:password> Server user and password -A, --user-agent <name> Send User-Agent <name> to server -v, --verbose Make the operation more talkative -V, --version Show version number and quit This is not the full help, this menu is stripped into categories. Use "--help category" to get an overview of all categories. For all options use the manual or "--help all". [user1@localhost ~]$ [user1@localhost ~]$ curl -V curl 7.76.1 (x86_64-redhat-linux-gnu) libcurl/7.76.1 OpenSSL/3.0.1 zlib/1.2.11 brotli/1.0.9 libidn2/2.3.0 libpsl/0.21.1 (+libidn2/2.3.0) libssh/0.9.6/openssl/zlib nghttp2/1.43.0 Release-Date: 2021-04-14 Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp Features: alt-svc AsynchDNS brotli GSS-API HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets [user1@localhost ~]$ |
試用,會顯示該網站首頁的內容,要輸出成檔案可以用 -o 參數;可以指定某的網頁網址;但似乎沒有下載整個網站的功能。
[user1@localhost ~]$ curl https://www.hinet.net |
(完)
[研究]curl 7.76.1網路傳輸工具安裝、試用 (Rocky Linux 9.1)
https://shaurong.blogspot.com/2023/03/curl-7761-rocky-linux-91.html
[研究]wget 1.21.1 網站下載軟體安裝、測試 (Rocky Linux 9.1)
https://shaurong.blogspot.com/2023/03/wget-1211-rocky-linux-91.html
[研究]Wget for Windows 1.21.3試用
https://shaurong.blogspot.com/2023/03/wget-for-windows-1213.html
沒有留言:
張貼留言