what's the fastest way to sort file by the first letter of each line? should one use linux sort command or are there other more efficient alternatives? if I am using sort, how do I sort 开发者_高级运维only by the first letter and ignore the rest?
This will sort by the first character
sort -k1.1,1.1 filename
add -s
if you want to preserve the input order of lines with the same first character
精彩评论