movq
V2EX  ›  Apple

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

  •  
  •   movq · Jun 10, 2022 · 1430 views
    This topic created in 1627 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
    harmless
    Jun 10, 2022 via iPhone
    1
    ls -l | sort | awk ‘{print $9}’
    harmless
    harmless
    Jun 10, 2022 via iPhone
    2
    ls -l | awk ‘{print $9}’ | sort
    用这个
    ihwbunny
    ihwbunny
    Jun 11, 2022
    3
    find ~/Desktop -maxdepth 1 | sort -f
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1227 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 17:27 · PVG 01:27 · LAX 09:27 · JFK 12:27
    ♥ Do have faith in what you're doing.