title: Linux rename files based on input file
body: <p>I need to rename hundreds of files in Linux to change the unique identifier of each from the command line. For sake of examples, I have a file containing:</p>
  
  <pre><code>old_name1 new_name1
  old_name2 new_name2
  </code></pre>
  
  <p>and need to change the names from new to old IDs. The file names contain the IDs, but have extra characters as well. My plan is therefore to end up with:</p>
  
  <pre><code>abcd_old_name1_1234.txt ==&gt; abcd_new_name1_1234.txt
  abcd_old_name2_1234.txt ==&gt; abcd_new_name2_1234.txt
  </code></pre>
  
  <p>Use of <code>rename</code> is obviously fairly helpful here, but I am struggling to work out how to iterate through the file of the desired name changes and pass this as input into <code>rename</code>?</p>
  
  <p>Edit: To clarify, I am looking to make hundreds of <em>different</em> rename commands, the different changes that need to be made are listed in a text file.</p>
  
  <p>Apologies if this is already answered, I've has a good hunt, but can't find a similar case.</p>