<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>I Can Has Linux? &#187; rename</title>
	<atom:link href="http://icanhaslinux.com/category/rename/feed/" rel="self" type="application/rss+xml" />
	<link>http://icanhaslinux.com</link>
	<description>Invisible Patent Infringement!</description>
	<lastBuildDate>Mon, 29 Aug 2011 13:37:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>batch rename with regexps</title>
		<link>http://icanhaslinux.com/2007/09/13/batch-rename-with-regexps/</link>
		<comments>http://icanhaslinux.com/2007/09/13/batch-rename-with-regexps/#comments</comments>
		<pubDate>Thu, 13 Sep 2007 19:24:25 +0000</pubDate>
		<dc:creator>LightningCrash</dc:creator>
				<category><![CDATA[mv]]></category>
		<category><![CDATA[regexps]]></category>
		<category><![CDATA[rename]]></category>

		<guid isPermaLink="false">http://icanhaslinux.com/2007/09/13/batch-rename-with-regexps/</guid>
		<description><![CDATA[You may not know this, but when you browse to add photos to MySpace on Linux, it specifies *.jpg and a handful of other formats. This is perfectly fine in a Windows world, but MySpace must not remember hat Linux filenames are CASE SENSITIVE. So when I import photos to a folder and they&#8217;re all [...]]]></description>
			<content:encoded><![CDATA[<p>You may not know this, but when you browse to add photos to MySpace on Linux, it specifies *.jpg and a handful of other formats. This is perfectly fine in a Windows world, but MySpace must not remember hat Linux filenames are CASE SENSITIVE. So when I import photos to a folder and they&#8217;re all named IMG_0101.JPG, etc, they won&#8217;t show up in the MySpace upload form. So those 50 photos you want to upload of your last vacation won&#8217;t show up in the window.</p>
<p>So you try to use mv to rename them. Yes, mv will due globbing on filenames, but rename will do regexps.<br />
<code><br />
cd ~/photos/dirwithphotos<br />
rename 's/JPG$/jpg/' *.JPG<br />
</code></p>
<p>Done.<br />
You can go further with it, too. For instance, if I want to rename the files, since they&#8217;re all named IMG_0203.jpg<br />
<code><br />
cd ~/photos/icanhaslinux<br />
rename 's/^IMG/icanhaslinux/' *<br />
rename 's/JPG$/jpg' *<br />
</code></p>
<p>Easy enough, right?<br />
You can do more, since you have the full suite of regexps available, but that&#8217;s just a start.<br />
Grab the regexp cheatsheet and you can do even more unnecessarily complicated things!</p>
<p>woohoo!</p>
]]></content:encoded>
			<wfw:commentRss>http://icanhaslinux.com/2007/09/13/batch-rename-with-regexps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

