Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • Do you want it sorted in place or do you want the output in a new file? Commented Jul 1, 2015 at 19:35
  • Seems like a duplicate. Commented Jul 1, 2015 at 19:37
  • 1
    Just to be clear: do you want the first field to be sorted lexicographically (chr10...chr19 between chr1 and chr2), but the other fields numerically (7 before 10)? Commented Jul 1, 2015 at 21:54
  • sort -k1,1 -k2,2n -k3,3n Commented Jul 1, 2015 at 22:03
  • @StéphaneChazelas: Can you tell me what does 2,2n and 3,3n means basically why n and 2,2 and 3,3?? Commented Jul 2, 2015 at 14:47