How do I pipe or redirect the output of curl -v?

后端 未结 8 1863
挽巷
挽巷 2021-01-29 21:17

For some reason the output always gets printed to the terminal, regardless of whether I redirect it via 2> or > or |. Is there a way to get around this? Why is this happening?

8条回答
  •  一整个雨季
    2021-01-29 22:00

    Just my 2 cents. The below command should do the trick, as answered earlier

    curl -vs google.com 2>&1
    

    However if need to get the output to a file,

    curl -vs google.com > out.txt 2>&1
    

    should work.

提交回复
热议问题