【发布时间】:2018-01-22 15:27:05
【问题描述】:
我希望仅按文件名而不是整个路径的字母顺序对 find 命令的输出进行排序。
假设我有一堆文本文件:
./d/meanwhile/in/b.txt
./meanwhile/c.txt
./z/path/with/more/a.txt
./d/mored/dddd/d.txt
我正在寻找输出:
./z/path/with/more/a.txt
./d/meanwhile/in/b.txt
./meanwhile/c.txt
./d/mored/dddd/d.txt
我试过了:
find . -type f -name '*.txt' -print0 | sort -t
find . -name '*.txt' -exec ls -ltu {} \; | sort -n
find . -name '*.txt' | sort -n
...在其他排列中。
【问题讨论】:
标签: linux find alphabetical