验证curl版本小于7.40.0时,无法从服务器端获取想要的零k文件

219 篇文章 2 订阅

 

 

参考链接:https://blog.csdn.net/msdnchina/article/details/90731983

注意:

执行curl命令的os的os版本是rhel7.5

192.168.80.8的os版本是rhel8.0

[root@dbserver ~]# curl -N -k -u root:aaaaaa -O "scp://192.168.80.8/root/i-am-from-rhel8.txt"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
[root@dbserver ~]# echo $?  ----->>>>此时192.168.80.8/root/i-am-from-rhel8.txt是0k,curl命令执行成功(返回0),但是没有传输过来i-am-from-rhel8.txt文件,见下ls
0
[root@dbserver ~]# pwd
/root
[root@dbserver ~]# ls
anaconda-ks.cfg  Desktop  Documents  Downloads  Music  Pictures  pip-18.0  pip-18.0.tar  postgresql-10.4.tar.gz  Public  Templates  Videos

=================随意添加几个字符到192.168.80.8/root/i-am-from-rhel8.txt中,保存退出======================

[root@dbserver ~]# curl -N -k -u root:aaaaaa -O "scp://192.168.80.8/root/i-am-from-rhel8.txt"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100     4  100     4    0     0     10      0 --:--:-- --:--:-- --:--:--    10
100     4  100     4    0     0     10      0 --:--:-- --:--:-- --:--:--    10
[root@dbserver ~]# ll  ----->>>>此时192.168.80.8/root/i-am-from-rhel8.txt是4k,curl命令执行成功(返回0), 传输过来i-am-from-rhel8.txt文件,见本ll
total 30588
-rw-------. 1 root root      1781 May 22  2018 anaconda-ks.cfg
drwxr-xr-x. 2 root root         6 Nov  4  2018 Desktop
drwxr-xr-x. 2 root root         6 Nov  4  2018 Documents
drwxr-xr-x. 2 root root         6 Nov  4  2018 Downloads
-rw-r--r--. 1 root root         4 Jun  1 14:25 i-am-from-rhel8.txt
drwxr-xr-x. 2 root root         6 Nov  4  2018 Music
drwxr-xr-x. 2 root root         6 Nov  4  2018 Pictures
drwxr-xr-x. 6  501 games      216 Sep 26  2018 pip-18.0
-rw-r--r--. 1 root root   4659200 Sep 26  2018 pip-18.0.tar
-rw-r--r--. 1 root root  26652442 May 23  2018 postgresql-10.4.tar.gz
drwxr-xr-x. 2 root root         6 Nov  4  2018 Public
drwxr-xr-x. 2 root root         6 Nov  4  2018 Templates
drwxr-xr-x. 2 root root         6 Nov  4  2018 Videos
[root@dbserver ~]# curl -V
curl 7.29.0 (x86_64-redhat-linux-gnu) libcurl/7.29.0 NSS/3.28.4 zlib/1.2.7 libidn/1.28 libssh2/1.4.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp 
Features: AsynchDNS GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz unix-sockets 
[root@dbserver ~]# cat i-am-from-rhel8.txt 
abs
[root@dbserver ~]# curl -sN -k -u root:aaaaaa -O "scp://192.168.80.8/root/i-am-from-rhel8.txt"
                ------>>> -s代表静默模式。

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值