movq
V2EX  ›  Apple

ls 输出目录文件名时不能按照中文排序

  •  
  •   movq · Jun 10, 2022 · 1316 views
    This topic created in 1519 days ago, the information mentioned may be changed or developed.

    有办法可以让它用中文排序吗?因为我想按照中文排序获得一个目录里面的文件名。

    macOS ,理论上可以多选文件然后 command+C ,在文本编辑里面粘贴就得到了文件名,但是我这里面复制了 100 多个文件,粘贴不出来文件名,不知道是怎么回事

    3 replies    2022-06-11 09:37:12 +08:00
    harmless
        1
    harmless  
       Jun 10, 2022 via iPhone
    ls -l | sort | awk ‘{print $9}’
    harmless
        2
    harmless  
       Jun 10, 2022 via iPhone
    ls -l | awk ‘{print $9}’ | sort
    用这个
    ihwbunny
        3
    ihwbunny  
       Jun 11, 2022
    find ~/Desktop -maxdepth 1 | sort -f
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1153 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 17:44 · PVG 01:44 · LAX 10:44 · JFK 13:44
    ♥ Do have faith in what you're doing.