I have a file which is as below.
<a href="http://firstlink.com" title="title1">
<a href="http://secondlink.com" title="title2">
<a href="http://thirdlink.com" title="title3">
<a href="http://fourthlink.com" title="title4">
I am trying to extract only the URLs from the above file. I am using the below command.
grep -o '\".*\"' new.txt
However, the above command gives me the output as,
"http://firstlink.com" title="title1">
"http://secondlink.com" title="title2">
"http://thirdlink.com" title="title3">
"http://foruthlink.com" title="title4">
I am trying to extract only the URLs without the ""
. So, my expected output is,
http://firstlink.com
http://secondlink.com
http://thirdlink.com
http://fourthlink.com
How should I change the grep command? Or is it possible to do it in perl, awk or sed command?