今日,我使用curl从MongoDB官网上下载并安装MongoDB,输入以下command line后报如下错误:
$ sudo curl -0 https://fastdl.mongodb.org/osx/mongodb-osx-ssl-x86_64-4.0.5.tgz
Warning: Binary output can mess up your terminal. Use "--output -" to tell
Warning: curl to output it to your terminal anyway, or consider "--output
Warning: <FILE>" to save to a file.
这个错误到底skr啥意思呢,其实就是说,我们的这个命令是模糊的,其中“-0”的意思是“--remote-name”,这意味着:我们默认会用部分的远程URL的名字,作为本地下载并存储的名字。但这里curl命令显然不允许这么干,因为这可能会扰乱你的terminal(不知道具体原因)。所以,我们应该在command末尾加上“--output”指定下载的文件的名字
所以上面的command改为:
$ sudo curl -0 https://fastdl.mongodb.org/osx/mongodb-osx-ssl-x86_64-4.0.5.tgz --output mongo
这样就没问题了~