title: Find multiple files and rename them in Linux
body: <p>I am having files like <code>a_dbg.txt, b_dbg.txt ...</code> in a <code>Suse 10</code> system. I want to write a bash shell script which should rename these files by removing "_dbg" from them.</p>
  
  <p>Google suggested me to use <code>rename</code> command. So I executed the command <code>rename _dbg.txt .txt *dbg*</code> on the <code>CURRENT_FOLDER</code></p>
  
  <p>My actual <code>CURRENT_FOLDER</code> contains the below files.</p>
  
  <pre><code>CURRENT_FOLDER/a_dbg.txt
  CURRENT_FOLDER/b_dbg.txt
  CURRENT_FOLDER/XX/c_dbg.txt
  CURRENT_FOLDER/YY/d_dbg.txt
  </code></pre>
  
  <p>After executing the <code>rename</code> command, </p>
  
  <pre><code>CURRENT_FOLDER/a.txt
  CURRENT_FOLDER/b.txt
  CURRENT_FOLDER/XX/c_dbg.txt
  CURRENT_FOLDER/YY/d_dbg.txt
  </code></pre>
  
  <p>Its not doing recursively, how to make this command to rename files in all subdirectories. Like <code>XX</code> and <code>YY</code> I will be having so many subdirectories which name is unpredictable. And also my <code>CURRENT_FOLDER</code> will be having some other files also.</p>