I need to sort the following file by the rhdiskpower devices in the last column:
Total_MB Free_MB OS_MB Name Failgroup Library Label UDID Product Redund Path
1024 851 1024 OCRVOT1_0000 OCRVOT1_0000 System UNKNOWN /dev/rhdiskpower1
1024 853 1024 OCRVOT1_0002 OCRVOT1_0002 System UNKNOWN /dev/rhdiskpower11
1024 855 1024 OCRVOT1_0001 OCRVOT1_0001 System UNKNOWN /dev/rhdiskpower10
1024 884 1024 OCRVOT1_0003 OCRVOT1_0003 System UNKNOWN /dev/rhdiskpower2
1024 884 1024 OCRVOT1_0005 OCRVOT1_0005 System UNKNOWN /dev/rhdiskpower9
1024 885 1024 OCRVOT1_0004 OCRVOT1_0004 System UNKNOWN /dev/rhdiskpower8
8192 7563 8192 DBFCRED2_0000 DBFCRED2_0000 System UNKNOWN /dev/rhdiskpower12
8192 7564 8192 DBFCRED1_0000 DBFCRED1_0000 System UNKNOWN /dev/rhdiskpower3
8192 7568 8192 DBFCRED1_0001 DBFCRED1_0001 System UNKNOWN /dev/rhdiskpower4
8192 7569 8192 DBFCRED2_0001 DBFCRED2_0001 System UNKNOWN /dev/rhdiskpower13
65536 65441 65536 DBFCFLR1_0000 DBFCFLR1_0000 System UNKNOWN /dev/rhdiskpower7
409600 126488 409600 DBFCDAT1_0002 DBFCDAT1_0002 System UNKNOWN /dev/rhdiskpower5
409600 126492 409600 DBFCDAT1_0000 DBFCDAT1_0000 System UNKNOWN /dev/rhdiskpower14
409600 126504 409600 DBFCDAT1_0001 DBFCDAT1_0001 System UNKNOWN /dev/rhdiskpower15
After spending more time than I care to admit, I finally was able to do it with the following sort command:
sort -k 8.17bn <name of file>
My question is this: The "b" was the critical piece to making this sort work. Without the "b", it sorted numerically by the first column. I've read the sort man pages, and it says that the "b" ignores leading blank characters. Any idea how that relates to what I was trying to do here?