For Example suppose I have the following in a text file myfile.txt
Schwifty1 Schwifty2 Schwifty3 Schwifty4 Schwifty5 Schwifty6 Schwifty7 Schwifty8 Schwifty9 Schwifty10 ... ect ect ect... Schwifty20 Schwifty21 ... ect ect ect... Schwifty30 Schwifty31 using sort on this file will return something like:
Schwifty1 Schwifty10 Schwifty11 ......... Schwifty2 Schwifty20 Schwifty21 ......... Schwifty30 Schwifty31 Schwifty32 .......... I want it to actually be numerical based off the number attached to the end. Is there any way to accomplish this using the sort function?
sort -k1.9,1nshould do (that is the sort starting position is the 9th char). If you can't use a starting position then isolating the column to be sorted is the way to go...