When I curl
a file, and pipe it to a file or another command, I see output in my terminal. I am not sure how this happens, as the pipe is supposed to take all the output from curl, right?
For example:
$ curl http://www.archive.org/stream/Pi_to_100000000_places/pi.txt > /dev/null
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 129M 0 129M 0 0 22.5M 0 --:--:-- 0:00:05 --:--:-- 24.7M
Edit
I use curl like this:
curl http://www.archive.org/stream/Pi_to_100000000_places/pi.txt | some_other_command > some_file
I do not want to pipe the status to some_other_command, I was just wondering how it was able to display the status. However, showing how to redirect both streams added to the answer, so don't remove that.
curl
's output to/dev/null
for testing, right? I'm asking because the answers so far all feature how to redirect its standard output and standard error streams together. But if you're usingcurl
to download files on standard output, you do not want to redirect stdout and stderr to the same place--any output on stderr would corrupt the download! I know you've already accepted an answer, but would you be willing to edit this with an example of how you're usingcurl
? I think that would make this question more valuable to future readers in similar situations./dev/null
just for demonstrationcurl -s http://api.ipify.org
| some_command