如何在linux命令行中preg替换以下内容

How do I preg replace the following at linux command line

<link rel="pear-icon" sizes="100" href="../../pear.png" />

I want to preg replace away the ../../ to make it become

<link rel="pear-icon" sizes="100" href="pear.png" />

Because there a lot of ../../ in my link, how do i mass preg replace and recursive on all file that contain this ../../

Thanks !

Something like this should do the trick:

find . -name "*.php" -print | xargs sed -i 's/"\.\.\/\.\.\/pear\.png/"pear\.png/g'

Try it first on 1 file though... didnt test this myself