<?xml version='1.0'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:atom="http://www.w3.org/2005/Atom" >
<channel>
	<title><![CDATA[BOL: Linux Sort Commands for Bioinformatics]]></title>
	<link>https://bioinformaticsonline.com/pages/view/11313/linux-sort-commands-for-bioinformatics?</link>
	<atom:link href="https://bioinformaticsonline.com/pages/view/11313/linux-sort-commands-for-bioinformatics?" rel="self" type="application/rss+xml" />
	<description><![CDATA[]]></description>
	
	<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/pages/view/11313/linux-sort-commands-for-bioinformatics</guid>
	<pubDate>Sat, 31 May 2014 15:41:16 -0500</pubDate>
	<link>https://bioinformaticsonline.com/pages/view/11313/linux-sort-commands-for-bioinformatics</link>
	<title><![CDATA[Linux Sort Commands for Bioinformatics]]></title>
	<description><![CDATA[<p>Almost all the scripting languages such as Perl, Python etc have built-in sort, but unfortunately none of them are as flexible as sort command. But one when it come to space efficiency GNU sort stands at the top. It can sort a 20Gb file with less than 2Gb memory. It is not trivial to implement so powerful a sort by yourself.</p><p>sort a space-delimited file based on its first column, then the second if the first is the same, and so on:<br />sort input.txt</p><p>sort a huge file (GNU sort ONLY):<br />sort -S 1500M -t $HOME/tmp input.txt &gt; sorted.txt</p><p>sort starting from the third column, skipping the first two columns:<br />sort +2 input.txt</p><p>sort the second column as numbers, descending order; if identical, sort the 3rd as strings, ascending order:<br />sort -k2,2nr -k3,3 input.txt</p><p>sort starting from the 4th character at column 2, as numbers:<br />sort -k2.4n input.txt</p><p>More Linxu sort command information<br /><br />If you have any sort commands you'd like to share, please add them to our comments section below. For more help, you can also type:<br /><br />man sort<br /><br />or<br /><br />sort --help<br /><br />on your Unix/Linux system.</p>]]></description>
	<dc:creator>Rahul Nayak</dc:creator>
</item>

</channel>
</rss>