Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compare two different urls using Linux

Tags:

linux

diff

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 ~]#
like image 595
user1032531 Avatar asked Mar 25 '14 10:03

user1032531


1 Answers

Of course you can use curl, although it is a bit strange:

diff <(curl url1) <(curl url2)

In your case:

diff <(curl http://www.example.net/index.php) <(curl http://www.example.com/index.php)

Note you can use curl -s for a cleaner diff execution.

like image 109
fedorqui 'SO stop harming' Avatar answered Sep 23 '22 08:09

fedorqui 'SO stop harming'