Rename files based on a list
<p>I would like to rename all files in a folder based on a text file (<code>list.txt</code>) with two columns: <code>oldnam</code> (which represents the current name) and <code>newnam</code> (which contains the required new name). </p>

<p>My text file:</p>

<pre><code>df &lt;- "oldnam newnam
       TRTY_3.DOT 124325.DOT
       TRTY_4.DOT 123454.DOT
       TRTY_5.DOT 124355.DOT"
df &lt;- read.table(text=df, header=T)
write.table(df, "list.txt", col.names=T, row.names=F, quote=F)
</code></pre>

<p>It is possible to do it from R or directly in bash (both solutions could help a lot)?</p>