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,这个问题没想到困扰了我很久。。