Skip to main content
2 of 2
formatting the code like code and removing the closing thanks etc.
Eric Renouf
  • 18.7k
  • 7
  • 51
  • 66

How to print lines using find and sed in multiple files?

I've many files in a directories structure. I want to extract some string (namely urls) by using a regexp, from those files.

I've tried this :

find . -path "*alder/ * / * .html" -print | xargs sed -n "/http:\/\/[^'\"]*/p" > urls.txt

... but it does not work as expected. The find part works ok, the xargs one, ok but the sed one, no. All I get in urls.txt is the concatenation of all files.