<?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>Claus Witt &#187; bash oneliner</title> <atom:link href="http://www.clauswitt.com/tag/bash-oneliner/feed/" rel="self" type="application/rss+xml" /><link>http://www.clauswitt.com</link> <description>software and web developer</description> <lastBuildDate>Thu, 24 Jun 2010 20:07:03 +0000</lastBuildDate> <generator>http://wordpress.org/?v=2.9.2</generator> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>Converting Filenames to Lowercase with Bash</title><link>http://www.clauswitt.com/converting-filenames-to-lowercase-with-bash/</link> <comments>http://www.clauswitt.com/converting-filenames-to-lowercase-with-bash/#comments</comments> <pubDate>Wed, 03 Jun 2009 07:24:36 +0000</pubDate> <dc:creator>Claus Witt</dc:creator> <category><![CDATA[Development]]></category> <category><![CDATA[bash]]></category> <category><![CDATA[bash oneliner]]></category> <category><![CDATA[import script]]></category> <category><![CDATA[voicearchive]]></category><guid isPermaLink="false">http://www.clauswitt.com/?p=246</guid> <description><![CDATA[Once again I have a bash-oneliner. For some reason it is all I blog about at the moment. I had an import script for importing demo files (in mp3 format) to a database used at Voicearchive. Only problem the import script depended on the files being named precisely according to a specific rule. But for [...]]]></description> <content:encoded><![CDATA[<p>Once again I have a bash-oneliner. For some reason it is all I blog about at the moment.</p><p>I had an import script for importing demo files (in mp3 format) to a database used at <a href="http://www.voicearchive.com/">Voicearchive</a>. Only problem the import script depended on the files being named precisely according to a specific rule. But for some reason some times it was named with uppercase letters, and sometimes with lowercase letters. I decided to rename all files to lowercase, and change the importscript accordingly.</p><pre name="code" class="bash">
find . -maxdepth 1 -type f -execdir rename 'y/A-Z/a-z/' '{}' \;
</pre>]]></content:encoded> <wfw:commentRss>http://www.clauswitt.com/converting-filenames-to-lowercase-with-bash/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Bash Oneliner for Counting Files</title><link>http://www.clauswitt.com/bash-oneliner-for-counting-files/</link> <comments>http://www.clauswitt.com/bash-oneliner-for-counting-files/#comments</comments> <pubDate>Thu, 14 May 2009 09:56:51 +0000</pubDate> <dc:creator>Claus Witt</dc:creator> <category><![CDATA[Development]]></category> <category><![CDATA[bash]]></category> <category><![CDATA[bash oneliner]]></category> <category><![CDATA[counting files]]></category><guid isPermaLink="false">http://www.clauswitt.com/?p=236</guid> <description><![CDATA[I needed to find a way to count the number of files in a directory and only output that number. Bash is still my best friend for this sort of thing &#8211; especially with a little help from google.ls -1 &#124; wc -lby the way &#8211; the answer was 2062 files. ]]></description> <content:encoded><![CDATA[<p>I needed to find a way to count the number of files in a directory and only output that number. Bash is still my best friend for this sort of thing &#8211; especially with a little help from google.</p><pre name="code" class="bash">
ls -1 | wc -l
</pre><p>by the way &#8211; the answer was 2062 files.</p> ]]></content:encoded> <wfw:commentRss>http://www.clauswitt.com/bash-oneliner-for-counting-files/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using memcached
Page Caching using memcached (user agent is rejected)
Database Caching using memcached

Served from: www.clauswitt.com @ 2010-07-30 04:29:41 -->