本文翻译自:How do I get cURL to not show the progress bar?

I'm trying to use cURL in a script and get it to not show the progress bar. 我正在尝试在脚本中使用cURL,并使其显示进度栏。

I've tried the -s , -silent , -S , and -quiet options, but none of them work. 我尝试了-s-silent-S-quiet选项,但是它们都不起作用。

Here's a typical command I've tried: 这是我尝试过的典型命令:

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

I only get the progress bar when pushing it to a file, so curl -s http://google.com doesn't have a progress bar, but curl -s http://google.com > temp.html does. 我只在将进度条推送到文件时才看到进度条,所以curl -s http://google.com没有进度条,但是curl -s http://google.com > temp.html有。


#1楼

参考:https://stackoom.com/question/UwFU/如何获取cURL以不显示进度栏


#2楼

I found that with curl 7.18.2 the download progress bar is not hidden with: 我发现使用curl 7.18.2时,下载进度条没有隐藏:

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

but it is with: 但它具有:

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

#3楼

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: 在Ubuntu的curl版本7.22.0和OSX的7.24.0版本中, 不显示进度显示错误的解决方案是同时使用-s (-- --silent )和-S (-- --show-error ),如下所示:

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

This works for both redirected output > /some/file , piped output | less 这对于重定向输出> /some/file ,管道输出| less | less and outputting directly to the terminal for me. | less ,直接为我输出到终端。


#4楼

Some time ago wrote a simple script to do the scrapping for searching for example specific versions of jdk installed: 前段时间写了一个简单的脚本来抓取搜索安装的特定版本的jdk的示例:

#!/bin/bash
REPO_TAG_URL=$1SEARCH=`curl -s $REPO_TAG_URL`
NEXT_PAGE=`echo $SEARCH | jq -r .next`echo $SEARCH | jq '.results[].name'while [[ $NEXT_PAGE != 'null' ]]; doSEARCH=`curl -s $NEXT_PAGE`NEXT_PAGE=`echo $SEARCH | jq -r .next`echo $SEARCH | jq '.results[].name'
doneecho "Thats all folks"

You use it like this: ./script.sh https://registry.hub.docker.com/v2/repositories/library/tomcat/tags/ 您可以这样使用它: ./script.sh https://registry.hub.docker.com/v2/repositories/library/tomcat/tags/


#5楼

Not sure why it's doing that. 不知道为什么要这么做。 Try -s with the -o option to set the output file instead of > . 使用-o选项尝试-s来设置输出文件,而不是>


#6楼

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

works for curl version 7.19.5 on Ubuntu 9.10 (no progress bar). 适用于Ubuntu 9.10上的curl版本7.19.5(无进度条)。 But if for some reason that does not work on your platform, you could always redirect stderr to /dev/null: 但是,如果由于某种原因在您的平台上不起作用,则可以始终将stderr重定向到/ dev / null:

curl  http://google.com 2>/dev/null > temp.html

如何获取cURL以不显示进度栏?相关推荐

  1. android multipartentity 怎么上传参数,android-通过MultipartEntityBuilder通过HTTP表单上传文件,并显示进度b...

    android-通过MultipartEntityBuilder通过HTTP表单上传文件,并显示进度b 短版本-.jar已弃用,其升级版本java.lang.NoClassDefFoundError在 ...

  2. qt 进度栏_HTML5进度栏

    qt 进度栏 The impressive growth of HTML5 has put forth a myriad of new interesting tools and elements t ...

  3. linux拷贝文件夹时获取进度,实现本机拷贝显示进度的方法

    实现本机拷贝显示进度的方法: 方法一:scp命令(推荐) # scp -r /mntroot@127.0.0.1:/home(拷贝文件夹要加参数 -r,拷贝文件不需要) (显示拷贝速度.剩余时间.已拷 ...

  4. 如何使用Django和Celery为Web构建进度栏

    制作表面上非常简单的东西的惊人复杂性 (The surprising complexity of making something that is, on its surface, ridiculou ...

  5. c语言yzk头文件,创建进度栏的步骤

    注意:其实只需要1.8两步就可以完成操作,其他的步骤没有起作用,写出来只是让大家明白创建的具体思路: 1.在CMainFrame的头文件中新建一个CProgressCtrl 的对象m_progress ...

  6. Linux添加cp和mv命令显示进度条

    Advanced Copy是cp和mv程序mod.它通过给cp和mv添加了一个进度条,在进行文件(夹)复制或移动操作时候提供进度条,数据传输速率,估计的剩余时间以及当前正在操作文件名等信息.最后,还会 ...

  7. java 文件读取 进度_读取文本文件时如何使用Java进度栏?

    我是java swing的新手,我想阅读文本文件.在读取该文件时,我想在java进度栏中显示已读行的百分比.欢迎任何示例代码.我试过了,但我不知道我的逻辑是否正确.我怎样才能做到这一点. import ...

  8. 硬件信息统计_读取输出Excel_显示进度

    #该脚本实现功能:通过WMI读取计算机硬件信息:计算机名称.IP地址.计算机型号.计算机序列号.BIOS版本.操作系统版本.CPU型号.CPU核心数量.内存大小.分区大小.网卡使用状态.网卡个数,并可 ...

  9. 使用OKHttp3实现下载(断点续传、显示进度)

    2019独角兽企业重金招聘Python工程师标准>>> OKHttp3 是如今非常流行的 Android 网络请求框架,那么如何利用 Android 实现断点续传呢,今天写了个 De ...

最新文章

  1. 每天五分钟linux(8)-cp
  2. Nginx(一)------简介与安装
  3. automapper
  4. 为什么我可以在Java中抛出null? [重复]
  5. 北航计算机考研 跨考,过来人分享:给外校跨考北航同学的建议
  6. 如何向5岁小孩解释什么是支持向量机(SVM)?
  7. 前端学习(3075):vue+element今日头条管理-反馈
  8. Ranger-Yarn插件安装
  9. java redirect 超时_会话超时后,Spring安全性不会重定向到上次请求的页面登录
  10. sap字段及描述底表_SAP各模块字段与表的对应关系.
  11. Redis - 学习笔记(1)
  12. 巨人肩膀上的迁移学习(2)---图像回归
  13. 计算机本科考金融本科自考,金融专业自考本科考哪几门,自考金融本科科目学习考试顺序?...
  14. css导航栏背景色透明,css如何设置背景颜色透明?css设置背景颜色透明度的两种方法介绍...
  15. 微信小程序之获取用户位置权限
  16. centos设置密码复杂度及最长使用时间
  17. Zotero 5.0 + 坚果云同步盘 + papership 配置教程
  18. iOS 图形处理 Core Graphics Quartz2D 教程
  19. VCS和Verdi的安装解决问题记录
  20. 监控工具zabbix安装及使用详解

热门文章

  1. android java 回调方法接口
  2. 安测云验证有CTA问题
  3. androidstudio常见问题
  4. Android Studio导入第三方类库的方法
  5. 手机下载Python_手机也能编程?盘点这6个可以用手机编程的App!快收藏
  6. Flutter Widget
  7. Hadoop伪分布式环境搭建
  8. java中sleep()、wait()相同与不同详解
  9. 网页加载报错——URL网页连接错误
  10. java 面试题之银行业务系统