<?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>rajaseelan.com &#187; bash</title>
	<atom:link href="http://rajaseelan.com/tag/bash/feed/" rel="self" type="application/rss+xml" />
	<link>http://rajaseelan.com</link>
	<description>junk food for the brain ...</description>
	<lastBuildDate>Tue, 28 Jul 2009 16:37:17 +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>Generate Files with Random Content and Size in Bash</title>
		<link>http://rajaseelan.com/2009/07/29/generate-files-with-random-content-and-size-in-bash/</link>
		<comments>http://rajaseelan.com/2009/07/29/generate-files-with-random-content-and-size-in-bash/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 16:37:17 +0000</pubDate>
		<dc:creator>raja</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[dd]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[generate]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://rajaseelan.com/?p=244</guid>
		<description><![CDATA[Occasionally you need to generate a bunch of random files with random content, usually for testing compression, user quotas or miscellaneous stuff.
Here&#8217;s one way, using the bash shell and a few handy linux utilities.

The bash $RANDOM function. It generates a random number between 0 &#8211; 32767.
Linux DD utility, to output files.
/dev/(h&#124;s)da, your hard drive in [...]]]></description>
			<content:encoded><![CDATA[<p>Occasionally you need to generate a bunch of random files with random content, usually for testing compression, user quotas or miscellaneous stuff.</p>
<p>Here&#8217;s one way, using the bash shell and a few handy linux utilities.</p>
<ol>
<li>The bash <code>$RANDOM</code> function. It generates a random number between 0 &#8211; 32767.</li>
<li>Linux <code>DD</code> utility, to output files.</li>
<li><code>/dev/(h|s)da</code>, your hard drive in linux.</li>
<li>All wrapped in a bash <code>while</code> loop.</li>
</ol>
<p>So lets start. First define a bash variable with the number of files we wish to create, lets say 10.</p>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;"><span style="color: #007800;">no_of_files</span>=<span style="color: #000000;">10</span></pre>
</div>
</div>
<p>Then we&#8217;ll assign the a bash variable for the counter.</p>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;"><span style="color: #007800;">counter</span>=<span style="color: #000000;">1</span></pre>
</div>
</div>
<p>As for the <code>dd</code> command, this creates a file with random content from your hard disk. (Mine&#8217;s <code>/dev/sda</code>)  which is 1KB in size. The <code>count</code> switch tells dd to repeat  1024 bytes 1 time, thus the 1Kb file size. <code>skip</code> makes <code>dd</code> skip an <em>x</em> amount of bytes before reading further. Since this requires raw access to your hard drive, you&#8217;ll have to run this as root unfortunately. <img src='http://rajaseelan.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">dd bs=1024 count=1 skip=0 if=/dev/sda of=random-file</pre>
</div>
</div>
<p>So now imagine, if we let bash assign the count and skip random numbers, we get random file contents. (Light bulbs flashing eh?)</p>
<p>Of course, all of it will be written to a single file called random-file in my case. To add just slight amount of variety, we can add the counter variable that we will use in our <code>while</code> loop as an extension. The <code>dd</code> command will now be:-</p>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;"> <span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;">bs</span>=<span style="color: #000000;">1024</span> <span style="color: #007800;">count</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$RANDOM</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #007800;">skip</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$RANDOM</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #007800;"><span style="color: #000000; font-weight: bold;">if</span></span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda <span style="color: #007800;">of</span>=random-file.<span style="color: #007800;">$counter</span></pre>
</div>
</div>
<p>Finally, we will wrap it up in a bash while loop like this:-</p>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;"><span style="color: #007800;">no_of_files</span>=<span style="color: #000000;">10</span>;
<span style="color: #007800;">counter</span>=<span style="color: #000000;">1</span>;
<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$counter</span> <span style="color: #660033;">-le</span> <span style="color: #007800;">$no_of_files</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>;
 <span style="color: #000000; font-weight: bold;">do</span> <span style="color: #7a0874; font-weight: bold;">echo</span> Creating <span style="color: #c20cb9; font-weight: bold;">file</span> no <span style="color: #007800;">$counter</span>;
  <span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;">bs</span>=<span style="color: #000000;">1024</span> <span style="color: #007800;">count</span>=<span style="color: #007800;">$RANDOM</span> <span style="color: #007800;">skip</span>=<span style="color: #007800;">$RANDOM</span> <span style="color: #007800;"><span style="color: #000000; font-weight: bold;">if</span></span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda <span style="color: #007800;">of</span>=random-file.<span style="color: #007800;">$counter</span>;
  <span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #ff0000;">&quot;counter += 1&quot;</span>;
 <span style="color: #000000; font-weight: bold;">done</span></pre>
</div>
</div>
<p>When you run it, you will get output like this:-</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">Creating file no 1
16614+0 records in
16614+0 records out
17012736 bytes (17 MB) copied, 0.29308 s, 58.0 MB/s
Creating file no 2
14456+0 records in
14456+0 records out
14802944 bytes (15 MB) copied, 0.100101 s, 148 MB/s
.................
Creating file no 10
25224+0 records in
25224+0 records out
25829376 bytes (26 MB) copied, 0.492113 s, 52.5 MB/s</pre>
</div>
</div>
<p>when you do a directory listing, you&#8217;ll see this:-</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">[root@atreides rd-test]# ls -lh
total 226M
-rw-r--r-- 1 root root 17M 2009-07-29 00:25 random-file.1
-rw-r--r-- 1 root root 25M 2009-07-29 00:25 random-file.10
-rw-r--r-- 1 root root 15M 2009-07-29 00:25 random-file.2
-rw-r--r-- 1 root root 20M 2009-07-29 00:25 random-file.3
-rw-r--r-- 1 root root 21M 2009-07-29 00:25 random-file.4
-rw-r--r-- 1 root root 30M 2009-07-29 00:25 random-file.5
-rw-r--r-- 1 root root 22M 2009-07-29 00:25 random-file.6
-rw-r--r-- 1 root root 27M 2009-07-29 00:25 random-file.7
-rw-r--r-- 1 root root 25M 2009-07-29 00:25 random-file.8
-rw-r--r-- 1 root root 29M 2009-07-29 00:25 random-file.9</pre>
</div>
</div>
<p>For more info, refer to the $RANDOM function from the <a target="blank" href="http://tldp.org/LDP/abs/html/randomvar.html">Advanced Bash Scripting Guide.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://rajaseelan.com/2009/07/29/generate-files-with-random-content-and-size-in-bash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Mass Rename Files in Linux</title>
		<link>http://rajaseelan.com/2009/07/12/how-to-mass-rename-files-in-linux/</link>
		<comments>http://rajaseelan.com/2009/07/12/how-to-mass-rename-files-in-linux/#comments</comments>
		<pubDate>Sun, 12 Jul 2009 14:12:15 +0000</pubDate>
		<dc:creator>raja</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[mass rename]]></category>
		<category><![CDATA[rename]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[sed]]></category>

		<guid isPermaLink="false">http://rajaseelan.com/?p=203</guid>
		<description><![CDATA[When entrusted with the chore of renaming multiple file, the convenience of a script shines. After all, we ain&#8217;t robots designed to do just one thing. Today, I&#8217;ll show one method of renaming files, using a for loop in bash.
First, the task we are going to do:
We have a list of files:


[raja@atreides test]$ ls
data_file_1  [...]]]></description>
			<content:encoded><![CDATA[<p>When entrusted with the chore of renaming multiple file, the convenience of a script shines. After all, we ain&#8217;t robots designed to do just one thing. Today, I&#8217;ll show one method of renaming files, using a <strong>for loop</strong> in bash.</p>
<p>First, the task we are going to do:</p>
<p>We have a list of files:</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">[raja@atreides test]$ ls
data_file_1   data_file_2  data_file_4  data_file_6  data_file_8
data_file_10  data_file_3  data_file_5  data_file_7  data_file_9</pre>
</div>
</div>
<p>We have been instructed to replace the underscores (<strong>_</strong>) in the file names with hyphens (<strong>-</strong>).</p>
<p>A menial task not really suited for humans. We&#8217;ll start building a script for this, one piece at a time.</p>
<ol>
<li>Check which type of shell you are using.
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">echo $SHELL</pre>
</div>
</div>
<p>As I am using bash scripting, make sure the result is <code>/bin/bash</code></li>
<li>List out all the file that you wish to rename
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">$ ls data_file_*</pre>
</div>
</div>
<p>It should give you output like this:-</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">[raja@atreides test]$ ls data_file_*
data_file_1   data_file_2  data_file_4  data_file_6  data_file_8
data_file_10  data_file_3  data_file_5  data_file_7  data_file_9</pre>
</div>
</div>
</li>
<li>Lets display each one of this in a for loop.
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">for</span> file_name <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ls</span> data_file_<span style="color: #000000; font-weight: bold;">*`</span>; <span style="color: #000000; font-weight: bold;">do</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;The file:&quot;</span> <span style="color: #007800;">$file_name</span>; <span style="color: #000000; font-weight: bold;">done</span></pre>
</div>
</div>
<p>What this for loop does is take each of the file names given by the <code>ls</code> command and store it in the <code>$file_name</code> bash variable. You&#8217;ll see this:-</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">[raja@atreides test]$ for file_name in `ls data_file_*`; do echo &quot;The file:&quot; $file_name; done
The file: data_file_1
The file: data_file_10
The file: data_file_2
The file: data_file_3
The file: data_file_4
The file: data_file_5
The file: data_file_6
The file: data_file_7
The file: data_file_8
The file: data_file_9</pre>
</div>
</div>
</li>
<li>Now that we&#8217;ve stored the file names in variables, we can use the <code>sed</code> command to edit it, replacing the underscores with a hyphen. I&#8217;ll <code>echo</code> the file name and pipe it to sed, to make sure it replaces the file name, and not modify the files itself.
<p>I used the sed replace command, <code>s</code> with a global option behind, the <code>g</code>, to make sure it replaces all occurrences of the underscore. Without the &#8216;g&#8217;, sed will only replace the first underscore and ignore the rest.</p>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">for</span> file_name <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ls</span> data_file_<span style="color: #000000; font-weight: bold;">*`</span>; <span style="color: #000000; font-weight: bold;">do</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;The file:&quot;</span> <span style="color: #007800;">$file_name</span>; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$file_name</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/_/-/g'</span> ; <span style="color: #000000; font-weight: bold;">done</span></pre>
</div>
</div>
<p>When you run this command in your console, you will see this output:</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">[raja@atreides test]$ for file_name in `ls data_file_*`; do echo &quot;The file:&quot; $file_name; echo $file_name | sed 's/_/-/g' ; done
The file: data_file_1
data-file-1
The file: data_file_10
data-file-10
The file: data_file_2
data-file-2
The file: data_file_3
data-file-3
The file: data_file_4
data-file-4
The file: data_file_5
data-file-5
The file: data_file_6
data-file-6
The file: data_file_7
data-file-7
The file: data_file_8
data-file-8
The file: data_file_9
data-file-9</pre>
</div>
</div>
</li>
<li>Of course, all this script is doing right now is editing the file name in the $file_name variable itself. Even though you can see what the modified file name will look like, we have not actually renamed the files on your hard disk yet. (This can be a good method of testing your sed-fu, before you really do it <img src='http://rajaseelan.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  )</li>
<li>In order to actually rename the file, I&#8217;ll put the results of sed&#8217;s transformation in a variable called <code>$new_file_name</code>.I&#8217;ll also print this out to the terminal, so you can see the changes that are about to take place.
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">for</span> file_name <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ls</span> data_file_<span style="color: #000000; font-weight: bold;">*`</span>; <span style="color: #000000; font-weight: bold;">do</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;The file:&quot;</span> <span style="color: #007800;">$file_name</span>; <span style="color: #007800;">new_file_name</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$file_name</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/_/-/g'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;New name:&quot;</span> <span style="color: #007800;">$new_file_name</span> ; <span style="color: #000000; font-weight: bold;">done</span></pre>
</div>
</div>
<p>You&#8217;ll then see this being output on the terminal:</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">[raja@atreides test]$ for file_name in `ls data_file_*`; do echo &quot;The file:&quot; $file_name; new_file_name=$(echo $file_name | sed 's/_/-/g'); echo &quot;New name:&quot; $new_file_name ; done
The file: data_file_1
New name: data-file-1
The file: data_file_10
New name: data-file-10
The file: data_file_2
New name: data-file-2
The file: data_file_3
New name: data-file-3
The file: data_file_4
New name: data-file-4
The file: data_file_5
New name: data-file-5
The file: data_file_6
New name: data-file-6
The file: data_file_7
New name: data-file-7
The file: data_file_8
New name: data-file-8
The file: data_file_9
New name: data-file-9</pre>
</div>
</div>
</li>
<li> Now that we&#8217;ve got both the old AND new file names, nicely stored in variables, its time to actually rename them using the <code>mv</code> command. The syntax for renaming is <code>mv current_file_name new_file_name</code>. I think you&#8217;re starting to see where these variables come in handy. <img src='http://rajaseelan.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">for</span> file_name <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ls</span> data_file_<span style="color: #000000; font-weight: bold;">*`</span>; <span style="color: #000000; font-weight: bold;">do</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;The file:&quot;</span> <span style="color: #007800;">$file_name</span>; <span style="color: #007800;">new_file_name</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$file_name</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/_/-/g'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;New name:&quot;</span> <span style="color: #007800;">$new_file_name</span> ; <span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #660033;">-v</span> <span style="color: #007800;">$file_name</span> <span style="color: #007800;">$new_file_name</span>; <span style="color: #000000; font-weight: bold;">done</span></pre>
</div>
</div>
<p>I&#8217;ve added a <code>-v</code> to the <code>mv</code>, so it displays what it is changing. As I always say, a little more verbosity is always good, especially on the terminal. Your final output will be something like this:-</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">[raja@atreides test]$ for file_name in `ls data_file_*`; do echo &quot;The file:&quot; $file_name; new_file_name=$(echo $file_name | sed 's/_/-/g'); echo &quot;New name:&quot; $new_file_name ; mv -v $file_name $new_file_name; done
The file: data_file_1
New name: data-file-1
`data_file_1' -&gt; `data-file-1'
The file: data_file_10
New name: data-file-10
`data_file_10' -&gt; `data-file-10'
The file: data_file_2
New name: data-file-2
`data_file_2' -&gt; `data-file-2'
The file: data_file_3
New name: data-file-3
`data_file_3' -&gt; `data-file-3'
The file: data_file_4
New name: data-file-4
`data_file_4' -&gt; `data-file-4'
The file: data_file_5
New name: data-file-5
`data_file_5' -&gt; `data-file-5'
The file: data_file_6
New name: data-file-6
`data_file_6' -&gt; `data-file-6'
The file: data_file_7
New name: data-file-7
`data_file_7' -&gt; `data-file-7'
The file: data_file_8
New name: data-file-8
`data_file_8' -&gt; `data-file-8'
The file: data_file_9
New name: data-file-9
`data_file_9' -&gt; `data-file-9'</pre>
</div>
</div>
<p>An <code>ls</code> will reveal that all files have really been changed this time.</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">[raja@atreides test]$ ls
data-file-1   data-file-2  data-file-4  data-file-6  data-file-8
data-file-10  data-file-3  data-file-5  data-file-7  data-file-9</pre>
</div>
</div>
<p>This should give you an idea on how to mass rename files. Of course there are probably better ways. Please do comment if you know some.
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://rajaseelan.com/2009/07/12/how-to-mass-rename-files-in-linux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Create Multiple Firefox Profiles For Different Uses</title>
		<link>http://rajaseelan.com/2009/02/22/create-multiple-firefox-profiles-for-different-uses/</link>
		<comments>http://rajaseelan.com/2009/02/22/create-multiple-firefox-profiles-for-different-uses/#comments</comments>
		<pubDate>Sun, 22 Feb 2009 03:36:40 +0000</pubDate>
		<dc:creator>raja</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Life]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[firefox]]></category>

		<guid isPermaLink="false">http://rajaseelan.com/?p=52</guid>
		<description><![CDATA[Ever had a problem where your Firefox crashes during development because you were browsing multiple tabs in another window?
Or using the latest Firefox beta always messed up your current extensions / settings?
Use Profile Manager.
This keeps separate instances of firefox running, so one crash won&#8217;t affect the other windows.
To access the Profile Manager, first open Firefox [...]]]></description>
			<content:encoded><![CDATA[<p>Ever had a problem where your <a href="http://www.mozilla.com/firefox/">Firefox</a> crashes during development because you were browsing multiple tabs in another window?</p>
<p>Or using the latest Firefox beta always messed up your current extensions / settings?</p>
<p>Use Profile Manager.</p>
<p>This keeps separate instances of firefox running, so one crash won&#8217;t affect the other windows.</p>
<p>To access the Profile Manager, first open Firefox as usual, then from the your os command prompt, launch the profile manager by typing the following command:-</p>
<p><code>firefox -profilemanager -no-remote</code></p>
<p><img src="http://rajaseelan.com/wp-content/uploads/2009/02/firefox-profile-manager.png" alt="My FireFox Profile Manager" /></p>
<p>As you can see, I have created 3 profiles here, my default profile, a Development profile as well as another beta profile for me to test the latest firefox beta, Minefield (www.mozilla.org/projects/minefield/). I set the default profile as my default (duh!), for normal web browsing.</p>
<p>The &#8216;-no-remote&#8217; option allows you to start a new Firefox process that is invisible to the first process.</p>
<p>The &#8216;-P&#8217; option allows you to specify which profile to start. Look at your profile manager for the names in case you forgot <img src='http://rajaseelan.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>I then created some scripts in my ~/bin directory to launch the Development &#038; Beta profiles seperately.</p>
<p>Here&#8217;s a sample script, note that I piped all of &#8216;em ugly error messages to /dev/null and made sure the process ran in the background. This frees up your terminal for more important things.</p>
<div class="wp_syntax">
<table>
<tr>
<td class="line_numbers">
<pre>1
2
3
</pre>
</td>
<td class="code">
<pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Starting devfox ;)&quot;</span>
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>firefox <span style="color: #660033;">-P</span> <span style="color: #ff0000;">&quot;Development&quot;</span> <span style="color: #660033;">-no-remote</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">&amp;</span></pre>
</td>
</tr>
</table>
</div>
<p>Another tip, getting confused with which profile(s) you have open? Use <a href="https://addons.mozilla.org/firefox/browse/type:2">Themes</a> to differentiate them <img src='http://rajaseelan.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>For more information, read on the following links:-</p>
<p><a href="http://kb.mozillazine.org/Opening_a_new_instance_of_Firefox_with_another_profile">Opening Firefox With Another Profile</a><br />
<a href="http://kb.mozillazine.org/Profile_Manager">Firefox Profile Manager</a></p>
<p>Other uses for this include, your own &#8216;incognito&#8217; mode for firefox, ala Chrome.</p>
<p>Hope you find this helpful <img src='http://rajaseelan.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://rajaseelan.com/2009/02/22/create-multiple-firefox-profiles-for-different-uses/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
