使用Linux比较两个不同的URL [英] Compare two different urls using Linux
本文介绍了使用Linux比较两个不同的URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我可以比较两个不同的url/网站,而无需先使用wget
或类似的文件下载文件.我尝试了以下操作,但收到以下错误.
Am I able to compare two different urls/websites without downloading the file first using wget
or something similar first. I tried the following, but received the below error.
[root@desktop ~]# diff http://www.example.net/index.php http://www.example.com/index.php
diff: http://www.example.net/index.php: No such file or directory
diff: http://www.example.com/index.php: No such file or directory
[root@desktop ~]#
推荐答案
您当然可以使用curl
,尽管有点奇怪:
Of course you can use curl
, although it is a bit strange:
diff <(curl url1) <(curl url2)
在您的情况下:
diff <(curl http://www.example.net/index.php) <(curl http://www.example.com/index.php)
请注意,您可以使用curl -s
进行更清晰的差异执行.
Note you can use curl -s
for a cleaner diff execution.
这篇关于使用Linux比较两个不同的URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文