sort sort命令用于文本文件的排序。 下面是example.txt文件的内容。 f b c g a e d 执行sort命令对其进行排序。 $ sort example.txt a b c d e f g 参数 -R参数表示随机排序。 sort -R example.txt b d a c g e f