title: unix/macos - how to find all files and duplicate in place with a different extension
body: <p>So I want to grab all certain files then duplicate them in the same folder/location but with a different extension. So far I have this from another question <a href="https://stackoverflow.com/questions/15617016/copy-all-files-with-a-certain-extension-from-all-subdirectories">Copy all files with a certain extension from all subdirectories</a>:</p>
  
  <pre><code>find . -name \*.js -exec cp {} newDir \;
  </code></pre>
  
  <p>I want to duplicate all those <code>.js</code> files into <code>.ts</code> e.g. duplicate <code>functions.js</code> to <code>functions.ts</code> wherever it may be.</p>
  
  <p>more examples:</p>
  
  <pre><code>a/functions.js
  b/test.js
  c/another.js
  index.js
  </code></pre>
  
  <p>to</p>
  
  <pre><code>a/functions.ts
  b/test.ts
  c/another.ts
  index.ts
  </code></pre>