1. cat test.txt
c
b
x
d
A
E
f
a
S
u
t
T
S
s
2. sort test.txt
a
A
b
c
d
E
f
s
S
S
t
T
u
x
3. export LC_ALL=C
4. sort test.txt
A
E
S
S
T
a
b
c
d
f
s
t
u
x
Linux下的sort函數是通過locale來判斷的,可以將LC_ALL設置爲C,從而使得排序按照ASCII,這個問題沒想到困擾了我很久。。