<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How To Rename Multiple Files Together in Linux Using 3 Methods</title>
	<atom:link href="http://www.thegeekstuff.com/2009/06/how-to-rename-files-in-group/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thegeekstuff.com/2009/06/how-to-rename-files-in-group/</link>
	<description>Guides, HowTos and Tips for Technology Geeks</description>
	<lastBuildDate>Mon, 15 Mar 2010 10:13:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Nick Stoianov</title>
		<link>http://www.thegeekstuff.com/2009/06/how-to-rename-files-in-group/comment-page-1/#comment-24586</link>
		<dc:creator>Nick Stoianov</dc:creator>
		<pubDate>Wed, 02 Dec 2009 23:02:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=509#comment-24586</guid>
		<description>FYI: rename command in RedHat DOES NOT accept perl regular expressions. So.....the command:  rename s/.html/.htm/ *.html   WILL NOT work on RedHat. 

If you want to use regex on Redhat in renaming files - use: ren

Example: /usr/local/bin/ren &#039;s/ //g&#039; *.txt  

This example will remove all the white spaces from the text files in a directory.</description>
		<content:encoded><![CDATA[<p>FYI: rename command in RedHat DOES NOT accept perl regular expressions. So&#8230;..the command:  rename s/.html/.htm/ *.html   WILL NOT work on RedHat. </p>
<p>If you want to use regex on Redhat in renaming files &#8211; use: ren</p>
<p>Example: /usr/local/bin/ren &#8217;s/ //g&#8217; *.txt  </p>
<p>This example will remove all the white spaces from the text files in a directory.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ramesh Natarajan</title>
		<link>http://www.thegeekstuff.com/2009/06/how-to-rename-files-in-group/comment-page-1/#comment-11495</link>
		<dc:creator>Ramesh Natarajan</dc:creator>
		<pubDate>Mon, 15 Jun 2009 05:33:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=509#comment-11495</guid>
		<description>&lt;strong&gt;@Binny,&lt;/strong&gt;

Thanks for the information about KRename, which definitely a very useful tool.
&lt;Code&gt;&#160;&lt;/code&gt;

For those who have not used KRename, check-out some &lt;a href=&quot;http://www.krename.net/Screenshots.11.0.html&quot; rel=&quot;nofollow&quot;&gt;screenshots of Krename&lt;/a&gt;
&lt;Code&gt;&#160;&lt;/code&gt;

&lt;strong&gt;@Iftikhar,&lt;/strong&gt;

Thanks for the info. mmv looks similar to rename. Is there anything special that mmv does which rename cannot do? (or) Is it pretty much the same?

&lt;Code&gt;&#160;&lt;/code&gt;

&lt;strong&gt;@Nardi,&lt;/strong&gt;

Your for-loop is similar to the method-2. Thanks for showing your detailed examples on how you do the move.

&lt;Code&gt;&#160;&lt;/code&gt;

&lt;strong&gt;@Nabin,&lt;/strong&gt;

I&#039;m not sure whether there is a single command that will do the swap. I hope someone else can throw some ideas on your question. One thing that came to my mind is -- Instead of doing multiple mv&#039;s probably you can create a alias called mvswap which can have the multiple mv commands. 

&lt;Code&gt;&#160;&lt;/code&gt;
&lt;strong&gt;@Flynets,&lt;/strong&gt;

Replacing space in a filename with underscore or hypen in a common requirement. Thanks for sharing your great example to solve that problem.</description>
		<content:encoded><![CDATA[<p><strong>@Binny,</strong></p>
<p>Thanks for the information about KRename, which definitely a very useful tool.<br />
<code>&nbsp;</code></p>
<p>For those who have not used KRename, check-out some <a href="http://www.krename.net/Screenshots.11.0.html" rel="nofollow">screenshots of Krename</a><br />
<code>&nbsp;</code></p>
<p><strong>@Iftikhar,</strong></p>
<p>Thanks for the info. mmv looks similar to rename. Is there anything special that mmv does which rename cannot do? (or) Is it pretty much the same?</p>
<p><code>&nbsp;</code></p>
<p><strong>@Nardi,</strong></p>
<p>Your for-loop is similar to the method-2. Thanks for showing your detailed examples on how you do the move.</p>
<p><code>&nbsp;</code></p>
<p><strong>@Nabin,</strong></p>
<p>I'm not sure whether there is a single command that will do the swap. I hope someone else can throw some ideas on your question. One thing that came to my mind is -- Instead of doing multiple mv's probably you can create a alias called mvswap which can have the multiple mv commands. </p>
<p><code>&nbsp;</code><br />
<strong>@Flynets,</strong></p>
<p>Replacing space in a filename with underscore or hypen in a common requirement. Thanks for sharing your great example to solve that problem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Flynets</title>
		<link>http://www.thegeekstuff.com/2009/06/how-to-rename-files-in-group/comment-page-1/#comment-11478</link>
		<dc:creator>Flynets</dc:creator>
		<pubDate>Sun, 14 Jun 2009 14:07:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=509#comment-11478</guid>
		<description>Replace space char with underscore from files
find . -type f -iname &quot;*.mp3&quot; -exec rename &quot;s/ /_/g&quot; {} \;</description>
		<content:encoded><![CDATA[<p>Replace space char with underscore from files<br />
find . -type f -iname &#8220;*.mp3&#8243; -exec rename &#8220;s/ /_/g&#8221; {} \;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nabin Limbu</title>
		<link>http://www.thegeekstuff.com/2009/06/how-to-rename-files-in-group/comment-page-1/#comment-11467</link>
		<dc:creator>Nabin Limbu</dc:creator>
		<pubDate>Sun, 14 Jun 2009 06:16:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=509#comment-11467</guid>
		<description>Hi, 

There are lots of time when we require to swap files between two configuration files. Is there any single command which will swap two files instead of writing 3 commands like this:  mv abc.txt  tmp.txt; mv def.txt abc.txt; mv tmp.txt def.txt</description>
		<content:encoded><![CDATA[<p>Hi, </p>
<p>There are lots of time when we require to swap files between two configuration files. Is there any single command which will swap two files instead of writing 3 commands like this:  mv abc.txt  tmp.txt; mv def.txt abc.txt; mv tmp.txt def.txt</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: NARDI</title>
		<link>http://www.thegeekstuff.com/2009/06/how-to-rename-files-in-group/comment-page-1/#comment-11464</link>
		<dc:creator>NARDI</dc:creator>
		<pubDate>Sat, 13 Jun 2009 20:57:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=509#comment-11464</guid>
		<description>wow.. didn&#039;t know that rename is so powerfull.  I&#039;ll try to use it instead of my favourite
   for f in * ; do mv &quot;$f&quot; &quot;${f//foo/bar}&quot; ; done
I&#039;m not sure if it was mentioned here before but JFYI: 

f=foofoo.foo

#replace first
echo ${f/foo/bar} # -&gt; barfoo.foo

#replace all occurences
echo ${f//foo/bar} # -&gt; barbar.bar

#replace first match from the beginning
echo ${f#f*f} # -&gt; oo.foo
#notice the &#039;star&#039; consumes only &#039;oo&#039; here

#replace all (longest match of regexp) from the beginning
echo ${f##f*f} # -&gt; oo
#here, there is &#039;oofoo.&#039; hidden under the &#039;star&#039; in regex &#039;f*f&#039; 

#extension replacement
echo ${f%foo}bar # -&gt; foofoo.bar

#replace first from the end
echo ${f%oo*} # -&gt; foofoo.f

#replace all (longest match of regexp) from the end
echo ${f%%oo*} # -&gt; f

enjoy =)</description>
		<content:encoded><![CDATA[<p>wow.. didn&#8217;t know that rename is so powerfull.  I&#8217;ll try to use it instead of my favourite<br />
   for f in * ; do mv &#8220;$f&#8221; &#8220;${f//foo/bar}&#8221; ; done<br />
I&#8217;m not sure if it was mentioned here before but JFYI: </p>
<p>f=foofoo.foo</p>
<p>#replace first<br />
echo ${f/foo/bar} # -&gt; barfoo.foo</p>
<p>#replace all occurences<br />
echo ${f//foo/bar} # -&gt; barbar.bar</p>
<p>#replace first match from the beginning<br />
echo ${f#f*f} # -&gt; oo.foo<br />
#notice the &#8217;star&#8217; consumes only &#8216;oo&#8217; here</p>
<p>#replace all (longest match of regexp) from the beginning<br />
echo ${f##f*f} # -&gt; oo<br />
#here, there is &#8216;oofoo.&#8217; hidden under the &#8217;star&#8217; in regex &#8216;f*f&#8217; </p>
<p>#extension replacement<br />
echo ${f%foo}bar # -&gt; foofoo.bar</p>
<p>#replace first from the end<br />
echo ${f%oo*} # -&gt; foofoo.f</p>
<p>#replace all (longest match of regexp) from the end<br />
echo ${f%%oo*} # -&gt; f</p>
<p>enjoy =)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: !ncognito</title>
		<link>http://www.thegeekstuff.com/2009/06/how-to-rename-files-in-group/comment-page-1/#comment-11458</link>
		<dc:creator>!ncognito</dc:creator>
		<pubDate>Sat, 13 Jun 2009 14:41:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=509#comment-11458</guid>
		<description>1st method seems dead simple.. Nice post!</description>
		<content:encoded><![CDATA[<p>1st method seems dead simple.. Nice post!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Iftikhar Ul Hassan</title>
		<link>http://www.thegeekstuff.com/2009/06/how-to-rename-files-in-group/comment-page-1/#comment-11438</link>
		<dc:creator>Iftikhar Ul Hassan</dc:creator>
		<pubDate>Fri, 12 Jun 2009 18:59:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=509#comment-11438</guid>
		<description>Hi, that&#039;s really nice, thanks for the great post. 

But have you tried using the &quot;mmv&quot; command (multiple move). This utility is not part of linux standard command set (I don&#039;t know why) but it&#039;s really nice.

So you just need to install the utility

hassan@linux:~$ sudo apt-get install mmv

Then you can move multiple files very easily, here is an example. 

==&gt;I want to rename all files which have extension *.htm to *.html&lt;==

hassan@linux:~$ mmv &quot;*.htm &quot;  &quot;#1.html&quot; 


You can read more about it from the excellent tutorial here (http://linux.dsplabs.com.au/mmv-copy-append-link-move-multiple-files-under-linux-shell-bash-by-wildcard-patterns-p5/)</description>
		<content:encoded><![CDATA[<p>Hi, that&#8217;s really nice, thanks for the great post. </p>
<p>But have you tried using the &#8220;mmv&#8221; command (multiple move). This utility is not part of linux standard command set (I don&#8217;t know why) but it&#8217;s really nice.</p>
<p>So you just need to install the utility</p>
<p>hassan@linux:~$ sudo apt-get install mmv</p>
<p>Then you can move multiple files very easily, here is an example. </p>
<p>==&gt;I want to rename all files which have extension *.htm to *.html&lt;==</p>
<p>hassan@linux:~$ mmv &#8220;*.htm &#8221;  &#8220;#1.html&#8221; </p>
<p>You can read more about it from the excellent tutorial here (<a href="http://linux.dsplabs.com.au/mmv-copy-append-link-move-multiple-files-under-linux-shell-bash-by-wildcard-patterns-p5/" rel="nofollow">http://linux.dsplabs.com.au/mmv-copy-append-link-move-multiple-files-under-linux-shell-bash-by-wildcard-patterns-p5/</a>)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Binny V A</title>
		<link>http://www.thegeekstuff.com/2009/06/how-to-rename-files-in-group/comment-page-1/#comment-11435</link>
		<dc:creator>Binny V A</dc:creator>
		<pubDate>Fri, 12 Jun 2009 18:24:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=509#comment-11435</guid>
		<description>Thanks for the midnight commander tip - I did not know that. Anyway, I recommend using KRename for this - really nifty tool.</description>
		<content:encoded><![CDATA[<p>Thanks for the midnight commander tip &#8211; I did not know that. Anyway, I recommend using KRename for this &#8211; really nifty tool.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
