Linux Tip: SORT of linux

If you want to sort a tab limited file in ascending order according to one column (like 5th column), you can use:
sort -k5,5n input
However, if you want to sort the file in descending order ccording to one column (like 5th column), you cann't use:
sort -r -k5,5n input 
You can use:
sort -r n-k5,5 input 

 -n, --numeric-sort
          compare according to string numerical value
-r, --reverse
         reverse the result of comparisons

Comments

Popular posts from this blog

gspread error:gspread.exceptions.SpreadsheetNotFound

Update the TOC (table of content) of MS Word .docx documents with Python

P and q values in RNA Seq