How do I get cURL to not show the progress bar?

前端 未结 6 2047
一向
一向 2020-12-04 05:23

I\'m trying to use cURL in a script and get it to not show the progress bar.

I\'ve tried the -s, -silent,

相关标签:
6条回答
  • 2020-12-04 05:28
    curl -s http://google.com > temp.html
    

    works for curl version 7.19.5 on Ubuntu 9.10 (no progress bar). But if for some reason that does not work on your platform, you could always redirect stderr to /dev/null:

    curl  http://google.com 2>/dev/null > temp.html
    
    0 讨论(0)
  • 2020-12-04 05:39

    On MacOS 10.13.6 (High Sierra), the '-ss' option works. It is especially useful inside perl, in a command like curl -ss --get {someURL}, which frankly is a whole lot more simple than any of the LWP or HTTP wrappers, for just getting a website or webpage's contents.

    0 讨论(0)
  • 2020-12-04 05:42

    I found that with curl 7.18.2 the download progress bar is not hidden with:

    curl -s http://google.com > temp.html
    

    but it is with:

    curl -ss http://google.com > temp.html
    
    0 讨论(0)
  • 2020-12-04 05:42

    Not sure why it's doing that. Try -s with the -o option to set the output file instead of >.

    0 讨论(0)
  • 2020-12-04 05:53

    In curl version 7.22.0 on Ubuntu and 7.24.0 on OSX the solution to not show progress but to show errors is to use both -s (--silent) and -S (--show-error) like so:

    curl -sS http://google.com > temp.html
    

    This works for both redirected output > /some/file, piped output | less and outputting directly to the terminal for me.

    0 讨论(0)
  • 2020-12-04 05:54

    this could help..

    curl 'http://example.com' > /dev/null
    
    0 讨论(0)
提交回复
热议问题