1

How can I show the steps time of wget?

enter image description here

you see my snapshot, in my PC, I use wget to download a http page.

you see there have DNS resolve, TCP connection, and the HTTP response.

how can I show every step time?

so I can know every step using time:

(DNS resolve 3ms) (TCP connection 5ms) (HTTP response 10ms)

user7693832
  • 6,119
  • 19
  • 63
  • 114

1 Answers1

0

There is no specific way of getting this from wget. But you can use the answer to this question to get something close of what you want : Is there a Unix utility to prepend timestamps to stdin?

You have to be aware that output of wget is not going to stdout but to errors' ouput and you have to redirect it : with 2>&1

So it gives something like this :

------$ wget http://www.google.com 2>&1 | awk '{ print strftime("%Y-%m-%d %H:%M:%S"), $0; fflush(); }'
2020-08-04 22:55:46 --2020-08-04 22:55:46--  http://www.google.com/
2020-08-04 22:55:46 Résolution de www.google.com (www.google.com)… 2a00:1450:4007:80c::2004, 216.58.201.228
2020-08-04 22:55:46 Connexion à www.google.com (www.google.com)|2a00:1450:4007:80c::2004|:80… connecté.
2020-08-04 22:55:46 requête HTTP transmise, en attente de la réponse… 200 OK
2020-08-04 22:55:46 Taille : non indiqué [text/html]
2020-08-04 22:55:46 Enregistre : «index.html.10»
2020-08-04 22:55:46 
2020-08-04 22:55:46      0K .......... .                                           5,74M=0,002s
2020-08-04 22:55:46 
2020-08-04 22:55:46 2020-08-04 22:55:46 (5,74 MB/s) - «index.html.10» enregistré [11886]
2020-08-04 22:55:46 
Tuckbros
  • 417
  • 3
  • 13