June 2025
Beginner to intermediate
473 pages
13h 30m
English
For this example, we want to use curl to measure the time it takes to download the home page of a website. The curl command is written in the following way:
time=$(curl --connect-timeout 2 -s -S -w '%{time_total}\n' \ -o /dev/null 2> /tmp/curl.error \ https://example.com) The various components of this command have the following meanings:
--connect-timeout 2 aborts the connection setup attempt after 2 seconds.
-s suppresses status outputs about the download progress.
-S allows error outputs in deviation from this option.
-w writes the runtime of the command to the standard output. This information ends up in the time variable.
-o redirects the downloaded HTML file to /dev/null. Nothing is stored ...
Read now
Unlock full access