Use the -I option to fetch only the HTTP headers of the specified resource: curl -I -http2 Headers are passed between the client and the server with the request or the response. HTTP headers are colon-separated key-value pairs containing information such as user agent, content type, and encoding. This is useful if your connection drops during the download of a large file, and instead of starting the download from scratch, you can continue the previous one.įor example, if you are downloading the Ubuntu 18.04 iso file using the following command: curl -O Īnd suddenly your connection drops you can resume the download with: curl -C -O Get the HTTP Headers of a URL # You can resume a download by using the -C - option. In the following example we are downloading the Arch Linux and Debian iso files: curl -O \ -O Resume a Download # To download multiple files at once, use multiple -O options, followed by the URL to the file you want to download. Uppercase -O saves the file with its original filename: curl -O Download Multiple files # Lowercase -o saves the file with a predefined filename, which in the example below is vue-v2.6.10.js: curl -o vue-v2.6.10.js To save the result of the curl command, use either the -o or -O option. If no protocol is specified, curl tries to guess the protocol you want to use, and it will default to HTTP. The command will print the source code of the homepage in your terminal window. In its simplest form, when invoked without any option, curl displays the specified resource to the standard output.įor example, to retrieve the homepage you would run: curl
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |