Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Maybe am missing something but how do i sort in a descending order a list with this naming

B7
B40
B41
B42
B8
B43
B20
B45
B53
B47
B48
B5
B6

sort -n does not sort the way i would like

B5
B6
B7

and so on

share|improve this question
    
@Gilles answer here may help. –  pnuts Dec 3 '12 at 13:50
add comment

1 Answer

up vote 3 down vote accepted

Try this:

sort -k1.2n

This sorts by (the data starting at) the second char (2) of the first column (1), assuming numerical data (n).

share|improve this answer
    
Thanks for the tip!!! –  eastafri Dec 3 '12 at 14:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.