简体   繁体   中英

How to command curl to download into stderr

I want curl command to download a file of a certain size into stdout and redirect output to stderr currently my command doesn't download the total size of my file for some reason.

curl -s -w "%{stderr}%{size_download}:%{speed_download}\n" http://..someurl../1000mb 2>&1

output of this is

2602:118272,000

While the size of the file is 1000mbits it's only downloading 2602 bytes.

Don't you need follow redirects? Check with verbose -v To follow use -L :

curl -L -s -w "%{stderr}%{size_download}:%{speed_download}\n" http://..someurl../1000mb 2>&1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM