title: Rename a bunch of PNG images with ".jpg" extension to ".png"
body: <p>So I have a folder with thousands of image files, all of them saved as <code>.jpg</code>.</p>
  
  <p>The problem is that some of those files are actually PNG image files, so they don't open in a lot of programs, unless I manually change their extension to <code>.png</code>. For example, the Ubuntu image viewer throws this error:</p>
  
  <blockquote>
    <p>"Error interpreting JPEG image file (Not a JPEG file: starts with 0x89
    0x50)"</p>
  </blockquote>
  
  <p>I've already ran a <strong>hexdump</strong> of some of these files to confirm this error and it checks out.</p>
  
  <p>I'm looking for a simple way to find all the files with the wrong extension among the other files and change their extension. How would I do  this with a bash script for example? So far I have no idea. All help apreciated!</p>