<?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: Howto: Linux Rename Multiple Files At a Shell Prompt</title> <atom:link href="http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html/feed" rel="self" type="application/rss+xml" /><link>http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html</link> <description>This is a Linux sys admin journal by Vivek about sys admin work, Linux tips &#38; tricks, hacks, news and more.</description> <lastBuildDate>Fri, 10 Feb 2012 20:37:43 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>By: zougi</title><link>http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-178717</link> <dc:creator>zougi</dc:creator> <pubDate>Tue, 17 Jan 2012 14:55:32 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-178717</guid> <description>leopinzon&#039;s command didn&#039;t worked for me. I used this one:
find -name &#039;*exp_to_find_in_folders*&#039; -exec rename &quot;s/exp_to_find_for_replacement/exp_to_replace/&quot; {} \;</description> <content:encoded><![CDATA[<p>leopinzon&#8217;s command didn&#8217;t worked for me. I used this one:</p><p>find -name &#8216;*exp_to_find_in_folders*&#8217; -exec rename &#8220;s/exp_to_find_for_replacement/exp_to_replace/&#8221; {} \;</p> ]]></content:encoded> </item> <item><title>By: Nasp</title><link>http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-177429</link> <dc:creator>Nasp</dc:creator> <pubDate>Fri, 23 Dec 2011 21:03:01 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-177429</guid> <description>Well god points, but how about this :
rename muiltiple files in subfolders... (.nfo to movie.nfo )</description> <content:encoded><![CDATA[<p>Well god points, but how about this :</p><p>rename muiltiple files in subfolders&#8230; (.nfo to movie.nfo )</p> ]]></content:encoded> </item> <item><title>By: Bummer</title><link>http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-176924</link> <dc:creator>Bummer</dc:creator> <pubDate>Tue, 13 Dec 2011 13:53:20 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-176924</guid> <description>&quot;Figure 03-01-02: GradeBook class declaration with one method: Createing a Gradebook object an calling its displayMessage method.avi&quot;
How can we bulk rename files like this? These are located in subfolders like
&quot;Blaa: blaaaaah: bla bla: bla&quot; etc.
None of the posted above methods not working. :(
I need replace all these stupid &quot;:&quot;.</description> <content:encoded><![CDATA[<p>&#8220;Figure 03-01-02: GradeBook class declaration with one method: Createing a Gradebook object an calling its displayMessage method.avi&#8221;<br
/> How can we bulk rename files like this? These are located in subfolders like<br
/> &#8220;Blaa: blaaaaah: bla bla: bla&#8221; etc.</p><p>None of the posted above methods not working. :(<br
/> I need replace all these stupid &#8220;:&#8221;.</p> ]]></content:encoded> </item> <item><title>By: LinuxFTW</title><link>http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-176056</link> <dc:creator>LinuxFTW</dc:creator> <pubDate>Fri, 25 Nov 2011 06:25:05 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-176056</guid> <description> i=0; for image in *.jpg; do mv &quot;$image&quot; &quot;Name with spaces `printf &quot;%.3d&quot; $i`.jpg&quot;; ((i++)); done
Renames:
asdlkjas.jpg
reojsd.jpg
asfkjdf.jpg
to
Name with spaces 000.jpg
Name with spaces 001.jpg
Name with spaces 002.jpg</description> <content:encoded><![CDATA[<p>i=0; for image in *.jpg; do mv &#8220;$image&#8221; &#8220;Name with spaces `printf &#8220;%.3d&#8221; $i`.jpg&#8221;; ((i++)); done</p><p>Renames:</p><p>asdlkjas.jpg<br
/> reojsd.jpg<br
/> asfkjdf.jpg</p><p>to</p><p>Name with spaces 000.jpg<br
/> Name with spaces 001.jpg<br
/> Name with spaces 002.jpg</p> ]]></content:encoded> </item> <item><title>By: Lord Jaguar</title><link>http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-174884</link> <dc:creator>Lord Jaguar</dc:creator> <pubDate>Sun, 16 Oct 2011 08:15:11 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-174884</guid> <description>Hey,
Thanks for the tip, but the rename command didnt work on my Fedora 15 x64. I didnt get any error message, but the spaces didnt go ! As one suggested above, does it work only on debian systems ? I checked man rename, there is no info on usage. Just has description of the -v switch. I am using &quot;rename (util-linux 2.19.1)&quot;
Thanks !</description> <content:encoded><![CDATA[<p>Hey,</p><p>Thanks for the tip, but the rename command didnt work on my Fedora 15 x64. I didnt get any error message, but the spaces didnt go ! As one suggested above, does it work only on debian systems ? I checked man rename, there is no info on usage. Just has description of the -v switch. I am using &#8220;rename (util-linux 2.19.1)&#8221;</p><p>Thanks !</p> ]]></content:encoded> </item> <item><title>By: Kalleguld</title><link>http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-174777</link> <dc:creator>Kalleguld</dc:creator> <pubDate>Wed, 12 Oct 2011 15:29:42 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-174777</guid> <description>A little late , but here goes:
&lt;pre&gt;s/-.*\.mp3/.mp3/&lt;/pre&gt;
removes everything after the dash  and before the .mp3 (dash included)</description> <content:encoded><![CDATA[<p>A little late , but here goes:</p><pre>s/-.*\.mp3/.mp3/</pre><p>removes everything after the dash  and before the .mp3 (dash included)</p> ]]></content:encoded> </item> <item><title>By: Sakiwi</title><link>http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-174688</link> <dc:creator>Sakiwi</dc:creator> <pubDate>Fri, 07 Oct 2011 12:52:52 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-174688</guid> <description>rename &#039;s/[^[:print:]]/_/g&#039; *txt
This will replace all &#039;non-printable&#039; characters in the name with and underscore.
Or if that does not work try escaping the character, e.g:
rename &#039;s/\?/_/g;s/\:/_/g&#039; *.txt</description> <content:encoded><![CDATA[<p>rename &#8216;s/[^[:print:]]/_/g&#8217; *txt<br
/> This will replace all &#8216;non-printable&#8217; characters in the name with and underscore.</p><p>Or if that does not work try escaping the character, e.g:<br
/> rename &#8216;s/\?/_/g;s/\:/_/g&#8217; *.txt</p> ]]></content:encoded> </item> <item><title>By: Gary</title><link>http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-173885</link> <dc:creator>Gary</dc:creator> <pubDate>Mon, 12 Sep 2011 18:38:16 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-173885</guid> <description>@paxpacis-Appreciate your input. however, I don&#039;t think I understand your solution. Here are some example files:
AF_DD2795_199905_20110824.txt should be renamed to DD2795_199905_20110824_AF.raw
AF_DD2795_199905_20110924.txt should be renamed to DD2795_199905_20110924_AF.raw
How do I automate this?</description> <content:encoded><![CDATA[<p>@paxpacis-Appreciate your input. however, I don&#8217;t think I understand your solution. Here are some example files:<br
/> AF_DD2795_199905_20110824.txt should be renamed to DD2795_199905_20110824_AF.raw<br
/> AF_DD2795_199905_20110924.txt should be renamed to DD2795_199905_20110924_AF.raw<br
/> How do I automate this?</p> ]]></content:encoded> </item> <item><title>By: paxpacis</title><link>http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-173751</link> <dc:creator>paxpacis</dc:creator> <pubDate>Wed, 07 Sep 2011 12:58:26 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-173751</guid> <description>@Gary
rename XX_ &quot;&quot; *.txt; rename .txt _XX.ext *.txt
@VIVEK
I think your example about the AXEL-CRAZYFROG.mp3 file is not correct. The - will not be added with your code. I think you forgot to include the hypen in the original name.</description> <content:encoded><![CDATA[<p>@Gary<br
/> rename XX_ &#8220;&#8221; *.txt; rename .txt _XX.ext *.txt</p><p>@VIVEK<br
/> I think your example about the AXEL-CRAZYFROG.mp3 file is not correct. The &#8211; will not be added with your code. I think you forgot to include the hypen in the original name.</p> ]]></content:encoded> </item> <item><title>By: Gary</title><link>http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-173731</link> <dc:creator>Gary</dc:creator> <pubDate>Tue, 06 Sep 2011 16:01:11 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-173731</guid> <description>This is a very usefule and informative thread. However, i haven&#039;t quite got exactly how how I would do my renaming. I need to rename daily files from format
XX_AA1234_201109.txt to AA1234_201109_XX.ext. Note that I need to change both position of a string and the extension itself. Any suggestions would be highly appreciated!</description> <content:encoded><![CDATA[<p>This is a very usefule and informative thread. However, i haven&#8217;t quite got exactly how how I would do my renaming. I need to rename daily files from format<br
/> XX_AA1234_201109.txt to AA1234_201109_XX.ext. Note that I need to change both position of a string and the extension itself. Any suggestions would be highly appreciated!</p> ]]></content:encoded> </item> <item><title>By: swain</title><link>http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-173724</link> <dc:creator>swain</dc:creator> <pubDate>Tue, 06 Sep 2011 05:44:32 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-173724</guid> <description>Hi, I am trying to rename some files with .ext to ones without .ext in RedHat 5
For eg: files like &quot;ocean_11h20110906.txt&quot; have to renamed as &quot;ocean_11h20110906&quot;
tried almost all the commands mentioned above. i have several such files to be renamed without extensions. Can anyone help me out. Plz treat this as urgent.</description> <content:encoded><![CDATA[<p>Hi, I am trying to rename some files with .ext to ones without .ext in RedHat 5</p><p>For eg: files like &#8220;ocean_11h20110906.txt&#8221; have to renamed as &#8220;ocean_11h20110906&#8243;</p><p>tried almost all the commands mentioned above. i have several such files to be renamed without extensions. Can anyone help me out. Plz treat this as urgent.</p> ]]></content:encoded> </item> <item><title>By: koma931</title><link>http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-173565</link> <dc:creator>koma931</dc:creator> <pubDate>Fri, 26 Aug 2011 09:29:45 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-173565</guid> <description>On OSX I didn&#039;t have rename handy, so I came up with this to change extensions of a bunch of files:
find . -name &quot;*.ext1&quot; &#124; sed s/ext1// &#124; xargs -I % mv %.ext1 %.ext2
I imagine it could be done in a more simple fashion, but it works well if you need to swap something at the end or the beginning of the filenames.</description> <content:encoded><![CDATA[<p>On OSX I didn&#8217;t have rename handy, so I came up with this to change extensions of a bunch of files:<br
/> find . -name &#8220;*.ext1&#8243; | sed s/ext1// | xargs -I % mv %.ext1 %.ext2</p><p>I imagine it could be done in a more simple fashion, but it works well if you need to swap something at the end or the beginning of the filenames.</p> ]]></content:encoded> </item> <item><title>By: Chary</title><link>http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-173434</link> <dc:creator>Chary</dc:creator> <pubDate>Sat, 20 Aug 2011 06:04:04 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-173434</guid> <description>Very Helpful. Thank You :)</description> <content:encoded><![CDATA[<p>Very Helpful. Thank You :)</p> ]]></content:encoded> </item> <item><title>By: Scott</title><link>http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-172619</link> <dc:creator>Scott</dc:creator> <pubDate>Wed, 20 Jul 2011 20:11:39 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-172619</guid> <description>rename &quot;s/foo*/bar/g&quot; *.a
Renames any file with an .a extension that contains &quot;foo&quot; to &quot;bar&quot; in the directory.</description> <content:encoded><![CDATA[<p>rename &#8220;s/foo*/bar/g&#8221; *.a</p><p>Renames any file with an .a extension that contains &#8220;foo&#8221; to &#8220;bar&#8221; in the directory.</p> ]]></content:encoded> </item> <item><title>By: Vijay</title><link>http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-172188</link> <dc:creator>Vijay</dc:creator> <pubDate>Thu, 30 Jun 2011 09:37:09 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-172188</guid> <description>$ rename .bak .txt *.bak   - command worked for me to rename all *.bak to *.txt
Many Thanks</description> <content:encoded><![CDATA[<p>$ rename .bak .txt *.bak   &#8211; command worked for me to rename all *.bak to *.txt</p><p>Many Thanks</p> ]]></content:encoded> </item> <item><title>By: Muhammad El-Sergani</title><link>http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-172027</link> <dc:creator>Muhammad El-Sergani</dc:creator> <pubDate>Mon, 20 Jun 2011 11:50:39 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-172027</guid> <description>you can do the following:
# rename .png -hd.png *.png
How about that? :)
Let me know if you need any further help</description> <content:encoded><![CDATA[<p>you can do the following:<br
/> # rename .png -hd.png *.png</p><p>How about that? :)<br
/> Let me know if you need any further help</p> ]]></content:encoded> </item> <item><title>By: Muhammad El-Sergani</title><link>http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-172026</link> <dc:creator>Muhammad El-Sergani</dc:creator> <pubDate>Mon, 20 Jun 2011 10:23:47 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-172026</guid> <description>Excellent write up!!
Thank you sir...
Been browsing the internet for a while for this, and just came across this neat little command, instead of people writing different scripts and such.. AWESOME!!</description> <content:encoded><![CDATA[<p>Excellent write up!!<br
/> Thank you sir&#8230;</p><p>Been browsing the internet for a while for this, and just came across this neat little command, instead of people writing different scripts and such.. AWESOME!!</p> ]]></content:encoded> </item> <item><title>By: Zinc</title><link>http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-171856</link> <dc:creator>Zinc</dc:creator> <pubDate>Sat, 11 Jun 2011 11:23:14 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-171856</guid> <description>it follows perl rules.
What you need to do is to tell it:
rename &quot;s/-.+/\.mp3/&quot; *.mp3
The dash will register as it should. The stop right after the dash signifies a single character. The plus after that means &quot;one or more of the previous thing&quot;
to test it, you don&#039;t need to create a new file, just put -n right after rename like this:
rename -n &quot;s/-.+/\.mp3/&quot; *.mp3</description> <content:encoded><![CDATA[<p>it follows perl rules.</p><p>What you need to do is to tell it:</p><p>rename &#8220;s/-.+/\.mp3/&#8221; *.mp3</p><p>The dash will register as it should. The stop right after the dash signifies a single character. The plus after that means &#8220;one or more of the previous thing&#8221;</p><p>to test it, you don&#8217;t need to create a new file, just put -n right after rename like this:<br
/> rename -n &#8220;s/-.+/\.mp3/&#8221; *.mp3</p> ]]></content:encoded> </item> <item><title>By: Aarthi</title><link>http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-171798</link> <dc:creator>Aarthi</dc:creator> <pubDate>Wed, 08 Jun 2011 12:11:41 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-171798</guid> <description>Hey even I&#039;m working on this kind of renaming. Did the solution provided worked for you?? It didn&#039;t worked out for me. Please let me know how have you done it.
Thanks!</description> <content:encoded><![CDATA[<p>Hey even I&#8217;m working on this kind of renaming. Did the solution provided worked for you?? It didn&#8217;t worked out for me. Please let me know how have you done it.<br
/> Thanks!</p> ]]></content:encoded> </item> <item><title>By: Aarthi</title><link>http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-171797</link> <dc:creator>Aarthi</dc:creator> <pubDate>Wed, 08 Jun 2011 12:10:03 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#comment-171797</guid> <description>This rename ‘s/-*//’ *.mp3 did not work for me... Can you please tell me why it didn&#039;t?? Also, Could you please suggest if there is any approach for this...</description> <content:encoded><![CDATA[<p>This rename ‘s/-*//’ *.mp3 did not work for me&#8230; Can you please tell me why it didn&#8217;t?? Also, Could you please suggest if there is any approach for this&#8230;</p> ]]></content:encoded> </item> </channel> </rss>
