Recursively replace URLs in multiple text files

There used to be a nifty little utility I used for this kind of thing, but the below works just as well:

find ./ -type f | xargs sed -i 's|http://domain.com|../relative/path/or/whatever|g'

As with grep and other utilities, sed can take different characters to represent the division between fields. Above I used the pipe (”|”) as opposed to the standard slash found in most examples.

Tags: , , , ,

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Possibly Related:


Leave a Reply

Powered by WP Hashcash