Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有包含许多韩文字符的文件。例如:
저 가 항 공 사 인 도 의 항 공 사
我想使用 linux sort 对文件中的行进行排序,但 sort 不起作用。它给了我:
所以,sort 只对空格进行排序。这个怎么排序?
这与您系统的 LANG 环境变量有关。
为了对韩文字符进行排序,LANG 应设置为 ko_KR.utf-8。
LANG=ko_KR.utf-8 sort tmp.txt
应该适合您的需要:
가 공 공 도 사 사 의 인 저 항 항
:D
您应该知道另一个韩语语言环境ko_KR.euckr。
最近,似乎大多数发行版都使用 ko_KR.utf-8 作为默认的韩语语言环境,但 ko_KR.euckr 仍然被广泛使用。