<?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>thinkMoult &#187; bash</title>
	<atom:link href="http://thinkmoult.com/tag/bash/feed/" rel="self" type="application/rss+xml" />
	<link>http://thinkmoult.com</link>
	<description>Seriously who ever reads this description.</description>
	<lastBuildDate>Sun, 22 Jan 2012 04:58:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Tech tip #4: Copy a random set of files from a directory.</title>
		<link>http://thinkmoult.com/2010/01/12/tech-tip-4-copy-a-random-set-of-files-from-a-directory/</link>
		<comments>http://thinkmoult.com/2010/01/12/tech-tip-4-copy-a-random-set-of-files-from-a-directory/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 03:15:25 +0000</pubDate>
		<dc:creator>Dion Moult</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[copy]]></category>
		<category><![CDATA[directory]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[recursive]]></category>
		<category><![CDATA[tech tip]]></category>

		<guid isPermaLink="false">http://thinkmoult.com/2010/01/12/tech-tip-4-copy-a-random-set-of-files-from-a-directory/</guid>
		<description><![CDATA[More for archival purposes than anything, today I wanted to copy some songs out of my serious mess of a music &#34;collection&#34; onto my microSD card. I didn&#8217;t want to have to choose and I haven&#8217;t rated my songs so that wouldn&#8217;t help. Instead I wanted a random selection of songs. I&#8217;m not a bashmaster [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>More for archival purposes than anything, today I wanted to copy some songs out of my serious mess of a music &quot;collection&quot; onto my microSD card. I didn&#8217;t want to have to choose and I haven&#8217;t rated my songs so that wouldn&#8217;t help. Instead I wanted a random selection of songs. I&#8217;m not a bashmaster (absolutely pathetic at it, actually) but this is what I ended up using &#8211; after symlinking all of the various directories I had my files under together:</p>
<p>find -L /home/drive/music -type f -name &quot;*.mp3&quot; | sort -R | tail -n100 | while read file; do cp &quot;$file&quot; /media/disk/music/; done</p>
<p>-n100 represents how many files are going to be copied. Hope it helps somebody! Of course any improvements are welcome.</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://thinkmoult.com/2010/01/12/tech-tip-4-copy-a-random-set-of-files-from-a-directory/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

