How to replace recursively part of file name in bash
<p>I have a directory having subdirectories containing images files with a wrong name such like filename.jpg.jpg i want to replace this recursiveley with filename.jpg
i have tried:</p>

<pre><code>find ./ -type f -exec sed -i 's/string1/string2/g' {} \;
</code></pre>

<p>or</p>

<pre><code>sed -i 's/foo/bar/g' *
</code></pre>

<p>but none works</p>

<p>thank you</p>